packages feed

lens 4.7.0.1 → 4.8

raw patch · 91 files changed

+740/−591 lines, 91 filesdep +kan-extensionsdep −splitdep ~basedep ~primitivedep ~transformers-compatPVP ok

version bump matches the API change (PVP)

Dependencies added: kan-extensions

Dependencies removed: split

Dependency ranges changed: base, primitive, transformers-compat

API changes (from Hackage documentation)

- Control.Lens.At: instance a ~ a2 => Ixed (a, a2)
- Control.Lens.Each: instance c ~ d => Each (HashMap c a) (HashMap d b) a b
- Control.Lens.Each: instance c ~ d => Each (Map c a) (Map d b) a b
- Control.Lens.Equality: Identical :: Identical a b a b
- Control.Lens.Fold: headOf :: Getting (First a) s a -> s -> Maybe a
- Control.Lens.Getter: Const :: a -> Const a b
- Control.Lens.Getter: getConst :: Const a b -> a
- Control.Lens.Indexed: Indexed :: (i -> a -> b) -> Indexed i a b
- Control.Lens.Indexed: runIndexed :: Indexed i a b -> i -> a -> b
- Control.Lens.Internal.Bazaar: Bazaar :: (forall f. Applicative f => p a (f b) -> f t) -> Bazaar p a b t
- Control.Lens.Internal.Bazaar: Bazaar1 :: (forall f. Apply f => p a (f b) -> f t) -> Bazaar1 p a b t
- Control.Lens.Internal.Bazaar: BazaarT :: (forall f. Applicative f => p a (f b) -> f t) -> BazaarT p a b t
- Control.Lens.Internal.Bazaar: BazaarT1 :: (forall f. Apply f => p a (f b) -> f t) -> BazaarT1 p a b t
- Control.Lens.Internal.Bazaar: runBazaar :: Bazaar p a b t -> forall f. Applicative f => p a (f b) -> f t
- Control.Lens.Internal.Bazaar: runBazaar1 :: Bazaar1 p a b t -> forall f. Apply f => p a (f b) -> f t
- Control.Lens.Internal.Bazaar: runBazaarT :: BazaarT p a b t -> forall f. Applicative f => p a (f b) -> f t
- Control.Lens.Internal.Bazaar: runBazaarT1 :: BazaarT1 p a b t -> forall f. Apply f => p a (f b) -> f t
- Control.Lens.Internal.ByteString: traversedStrict :: Int -> IndexedTraversal' Int ByteString Word8
- Control.Lens.Internal.ByteString: traversedStrict8 :: Int -> IndexedTraversal' Int ByteString Char
- Control.Lens.Internal.Context: Context :: (b -> t) -> a -> Context a b t
- Control.Lens.Internal.Context: Pretext :: (forall f. Functor f => p a (f b) -> f t) -> Pretext p a b t
- Control.Lens.Internal.Context: PretextT :: (forall f. Functor f => p a (f b) -> f t) -> PretextT p a b t
- Control.Lens.Internal.Context: instance a ~ b => Comonad (Context a b)
- Control.Lens.Internal.Context: instance a ~ b => ComonadStore a (Context a b)
- Control.Lens.Internal.Context: runPretext :: Pretext p a b t -> forall f. Functor f => p a (f b) -> f t
- Control.Lens.Internal.Context: runPretextT :: PretextT p a b t -> forall f. Functor f => p a (f b) -> f t
- Control.Lens.Internal.Deque: BD :: !Int -> [a] -> !Int -> [a] -> Deque a
- Control.Lens.Internal.Exception: HandlingException :: HandlingException
- Control.Lens.Internal.Exception: instance (Reifies s (SomeException -> Maybe a), Typeable a, Typeable m, Typeable s) => Exception (Handling a s m)
- Control.Lens.Internal.Exception: instance Show (Handling a s m)
- Control.Lens.Internal.Exception: instance Typeable Handling
- Control.Lens.Internal.Exception: instance Typeable HandlingException
- Control.Lens.Internal.FieldTH: LensRules :: Bool -> Bool -> Bool -> Bool -> Bool -> (Name -> [Name] -> Name -> [DefName]) -> (Name -> Maybe (Name, Name)) -> LensRules
- Control.Lens.Internal.FieldTH: MethodName :: Name -> Name -> DefName
- Control.Lens.Internal.FieldTH: TopName :: Name -> DefName
- Control.Lens.Internal.FieldTH: _allowIsos :: LensRules -> Bool
- Control.Lens.Internal.FieldTH: _allowUpdates :: LensRules -> Bool
- Control.Lens.Internal.FieldTH: _classyLenses :: LensRules -> Name -> Maybe (Name, Name)
- Control.Lens.Internal.FieldTH: _fieldToDef :: LensRules -> Name -> [Name] -> Name -> [DefName]
- Control.Lens.Internal.FieldTH: _generateClasses :: LensRules -> Bool
- Control.Lens.Internal.FieldTH: _generateSigs :: LensRules -> Bool
- Control.Lens.Internal.FieldTH: _simpleLenses :: LensRules -> Bool
- Control.Lens.Internal.Fold: Folding :: f a -> Folding f a
- Control.Lens.Internal.Fold: LLeaf :: a -> Leftmost a
- Control.Lens.Internal.Fold: LPure :: Leftmost a
- Control.Lens.Internal.Fold: LStep :: (Leftmost a) -> Leftmost a
- Control.Lens.Internal.Fold: M :: a -> M a s
- Control.Lens.Internal.Fold: Max :: a -> Max a
- Control.Lens.Internal.Fold: Min :: a -> Min a
- Control.Lens.Internal.Fold: NoMax :: Max a
- Control.Lens.Internal.Fold: NoMin :: Min a
- Control.Lens.Internal.Fold: RLeaf :: a -> Rightmost a
- Control.Lens.Internal.Fold: RPure :: Rightmost a
- Control.Lens.Internal.Fold: RStep :: (Rightmost a) -> Rightmost a
- Control.Lens.Internal.Fold: ReifiedMonoid :: (a -> a -> a) -> a -> ReifiedMonoid a
- Control.Lens.Internal.Fold: Sequenced :: m a -> Sequenced a m
- Control.Lens.Internal.Fold: Traversed :: f a -> Traversed a f
- Control.Lens.Internal.Fold: getFolding :: Folding f a -> f a
- Control.Lens.Internal.Fold: getSequenced :: Sequenced a m -> m a
- Control.Lens.Internal.Fold: getTraversed :: Traversed a f -> f a
- Control.Lens.Internal.Fold: reifiedMappend :: ReifiedMonoid a -> a -> a -> a
- Control.Lens.Internal.Fold: reifiedMempty :: ReifiedMonoid a -> a
- Control.Lens.Internal.Getter: AlongsideLeft :: f (a, b) -> AlongsideLeft f b a
- Control.Lens.Internal.Getter: AlongsideRight :: f (a, b) -> AlongsideRight f a b
- Control.Lens.Internal.Getter: getAlongsideLeft :: AlongsideLeft f b a -> f (a, b)
- Control.Lens.Internal.Getter: getAlongsideRight :: AlongsideRight f a b -> f (a, b)
- Control.Lens.Internal.Indexed: Indexed :: (i -> a -> b) -> Indexed i a b
- Control.Lens.Internal.Indexed: Indexing :: (Int -> (Int, f a)) -> Indexing f a
- Control.Lens.Internal.Indexed: Indexing64 :: (Int64 -> (Int64, f a)) -> Indexing64 f a
- Control.Lens.Internal.Indexed: instance i ~ j => Indexable i (Indexed j)
- Control.Lens.Internal.Indexed: runIndexed :: Indexed i a b -> i -> a -> b
- Control.Lens.Internal.Indexed: runIndexing :: Indexing f a -> Int -> (Int, f a)
- Control.Lens.Internal.Indexed: runIndexing64 :: Indexing64 f a -> Int64 -> (Int64, f a)
- Control.Lens.Internal.Iso: Exchange :: (s -> a) -> (b -> t) -> Exchange a b s t
- Control.Lens.Internal.Level: Deepening :: (forall r. Int -> (Level i a -> Bool -> r) -> r) -> Deepening i a
- Control.Lens.Internal.Level: Flows :: ([Level i b] -> a) -> Flows i b a
- Control.Lens.Internal.Level: One :: i -> a -> Level i a
- Control.Lens.Internal.Level: Two :: {-# UNPACK #-} !Word -> !(Level i a) -> !(Level i a) -> Level i a
- Control.Lens.Internal.Level: Zero :: Level i a
- Control.Lens.Internal.Level: runDeepening :: Deepening i a -> forall r. Int -> (Level i a -> Bool -> r) -> r
- Control.Lens.Internal.Level: runFlows :: Flows i b a -> [Level i b] -> a
- Control.Lens.Internal.Magma: Mafic :: Int -> (Int -> Magma Int t b a) -> Mafic a b t
- Control.Lens.Internal.Magma: Magma :: i -> a -> Magma i b b a
- Control.Lens.Internal.Magma: MagmaAp :: Magma i (x -> y) b a -> Magma i x b a -> Magma i y b a
- Control.Lens.Internal.Magma: MagmaFmap :: (x -> y) -> Magma i x b a -> Magma i y b a
- Control.Lens.Internal.Magma: MagmaPure :: x -> Magma i x b a
- Control.Lens.Internal.Magma: Molten :: Magma i t b a -> Molten i a b t
- Control.Lens.Internal.Magma: TakingWhile :: Bool -> t -> (Bool -> Magma () t b (Corep p a)) -> TakingWhile p a b t
- Control.Lens.Internal.Magma: instance a ~ b => Comonad (Molten i a b)
- Control.Lens.Internal.Magma: runMolten :: Molten i a b t -> Magma i t b a
- Control.Lens.Internal.Prism: Market :: (b -> t) -> (s -> Either t a) -> Market a b s t
- Control.Lens.Internal.Reflection: instance Typeable Stable
- Control.Lens.Internal.Reflection: instance Typeable T0
- Control.Lens.Internal.Reflection: instance Typeable T1
- Control.Lens.Internal.Reflection: instance Typeable T10
- Control.Lens.Internal.Reflection: instance Typeable T100
- Control.Lens.Internal.Reflection: instance Typeable T101
- Control.Lens.Internal.Reflection: instance Typeable T102
- Control.Lens.Internal.Reflection: instance Typeable T103
- Control.Lens.Internal.Reflection: instance Typeable T104
- Control.Lens.Internal.Reflection: instance Typeable T105
- Control.Lens.Internal.Reflection: instance Typeable T106
- Control.Lens.Internal.Reflection: instance Typeable T107
- Control.Lens.Internal.Reflection: instance Typeable T108
- Control.Lens.Internal.Reflection: instance Typeable T109
- Control.Lens.Internal.Reflection: instance Typeable T11
- Control.Lens.Internal.Reflection: instance Typeable T110
- Control.Lens.Internal.Reflection: instance Typeable T111
- Control.Lens.Internal.Reflection: instance Typeable T112
- Control.Lens.Internal.Reflection: instance Typeable T113
- Control.Lens.Internal.Reflection: instance Typeable T114
- Control.Lens.Internal.Reflection: instance Typeable T115
- Control.Lens.Internal.Reflection: instance Typeable T116
- Control.Lens.Internal.Reflection: instance Typeable T117
- Control.Lens.Internal.Reflection: instance Typeable T118
- Control.Lens.Internal.Reflection: instance Typeable T119
- Control.Lens.Internal.Reflection: instance Typeable T12
- Control.Lens.Internal.Reflection: instance Typeable T120
- Control.Lens.Internal.Reflection: instance Typeable T121
- Control.Lens.Internal.Reflection: instance Typeable T122
- Control.Lens.Internal.Reflection: instance Typeable T123
- Control.Lens.Internal.Reflection: instance Typeable T124
- Control.Lens.Internal.Reflection: instance Typeable T125
- Control.Lens.Internal.Reflection: instance Typeable T126
- Control.Lens.Internal.Reflection: instance Typeable T127
- Control.Lens.Internal.Reflection: instance Typeable T128
- Control.Lens.Internal.Reflection: instance Typeable T129
- Control.Lens.Internal.Reflection: instance Typeable T13
- Control.Lens.Internal.Reflection: instance Typeable T130
- Control.Lens.Internal.Reflection: instance Typeable T131
- Control.Lens.Internal.Reflection: instance Typeable T132
- Control.Lens.Internal.Reflection: instance Typeable T133
- Control.Lens.Internal.Reflection: instance Typeable T134
- Control.Lens.Internal.Reflection: instance Typeable T135
- Control.Lens.Internal.Reflection: instance Typeable T136
- Control.Lens.Internal.Reflection: instance Typeable T137
- Control.Lens.Internal.Reflection: instance Typeable T138
- Control.Lens.Internal.Reflection: instance Typeable T139
- Control.Lens.Internal.Reflection: instance Typeable T14
- Control.Lens.Internal.Reflection: instance Typeable T140
- Control.Lens.Internal.Reflection: instance Typeable T141
- Control.Lens.Internal.Reflection: instance Typeable T142
- Control.Lens.Internal.Reflection: instance Typeable T143
- Control.Lens.Internal.Reflection: instance Typeable T144
- Control.Lens.Internal.Reflection: instance Typeable T145
- Control.Lens.Internal.Reflection: instance Typeable T146
- Control.Lens.Internal.Reflection: instance Typeable T147
- Control.Lens.Internal.Reflection: instance Typeable T148
- Control.Lens.Internal.Reflection: instance Typeable T149
- Control.Lens.Internal.Reflection: instance Typeable T15
- Control.Lens.Internal.Reflection: instance Typeable T150
- Control.Lens.Internal.Reflection: instance Typeable T151
- Control.Lens.Internal.Reflection: instance Typeable T152
- Control.Lens.Internal.Reflection: instance Typeable T153
- Control.Lens.Internal.Reflection: instance Typeable T154
- Control.Lens.Internal.Reflection: instance Typeable T155
- Control.Lens.Internal.Reflection: instance Typeable T156
- Control.Lens.Internal.Reflection: instance Typeable T157
- Control.Lens.Internal.Reflection: instance Typeable T158
- Control.Lens.Internal.Reflection: instance Typeable T159
- Control.Lens.Internal.Reflection: instance Typeable T16
- Control.Lens.Internal.Reflection: instance Typeable T160
- Control.Lens.Internal.Reflection: instance Typeable T161
- Control.Lens.Internal.Reflection: instance Typeable T162
- Control.Lens.Internal.Reflection: instance Typeable T163
- Control.Lens.Internal.Reflection: instance Typeable T164
- Control.Lens.Internal.Reflection: instance Typeable T165
- Control.Lens.Internal.Reflection: instance Typeable T166
- Control.Lens.Internal.Reflection: instance Typeable T167
- Control.Lens.Internal.Reflection: instance Typeable T168
- Control.Lens.Internal.Reflection: instance Typeable T169
- Control.Lens.Internal.Reflection: instance Typeable T17
- Control.Lens.Internal.Reflection: instance Typeable T170
- Control.Lens.Internal.Reflection: instance Typeable T171
- Control.Lens.Internal.Reflection: instance Typeable T172
- Control.Lens.Internal.Reflection: instance Typeable T173
- Control.Lens.Internal.Reflection: instance Typeable T174
- Control.Lens.Internal.Reflection: instance Typeable T175
- Control.Lens.Internal.Reflection: instance Typeable T176
- Control.Lens.Internal.Reflection: instance Typeable T177
- Control.Lens.Internal.Reflection: instance Typeable T178
- Control.Lens.Internal.Reflection: instance Typeable T179
- Control.Lens.Internal.Reflection: instance Typeable T18
- Control.Lens.Internal.Reflection: instance Typeable T180
- Control.Lens.Internal.Reflection: instance Typeable T181
- Control.Lens.Internal.Reflection: instance Typeable T182
- Control.Lens.Internal.Reflection: instance Typeable T183
- Control.Lens.Internal.Reflection: instance Typeable T184
- Control.Lens.Internal.Reflection: instance Typeable T185
- Control.Lens.Internal.Reflection: instance Typeable T186
- Control.Lens.Internal.Reflection: instance Typeable T187
- Control.Lens.Internal.Reflection: instance Typeable T188
- Control.Lens.Internal.Reflection: instance Typeable T189
- Control.Lens.Internal.Reflection: instance Typeable T19
- Control.Lens.Internal.Reflection: instance Typeable T190
- Control.Lens.Internal.Reflection: instance Typeable T191
- Control.Lens.Internal.Reflection: instance Typeable T192
- Control.Lens.Internal.Reflection: instance Typeable T193
- Control.Lens.Internal.Reflection: instance Typeable T194
- Control.Lens.Internal.Reflection: instance Typeable T195
- Control.Lens.Internal.Reflection: instance Typeable T196
- Control.Lens.Internal.Reflection: instance Typeable T197
- Control.Lens.Internal.Reflection: instance Typeable T198
- Control.Lens.Internal.Reflection: instance Typeable T199
- Control.Lens.Internal.Reflection: instance Typeable T2
- Control.Lens.Internal.Reflection: instance Typeable T20
- Control.Lens.Internal.Reflection: instance Typeable T200
- Control.Lens.Internal.Reflection: instance Typeable T201
- Control.Lens.Internal.Reflection: instance Typeable T202
- Control.Lens.Internal.Reflection: instance Typeable T203
- Control.Lens.Internal.Reflection: instance Typeable T204
- Control.Lens.Internal.Reflection: instance Typeable T205
- Control.Lens.Internal.Reflection: instance Typeable T206
- Control.Lens.Internal.Reflection: instance Typeable T207
- Control.Lens.Internal.Reflection: instance Typeable T208
- Control.Lens.Internal.Reflection: instance Typeable T209
- Control.Lens.Internal.Reflection: instance Typeable T21
- Control.Lens.Internal.Reflection: instance Typeable T210
- Control.Lens.Internal.Reflection: instance Typeable T211
- Control.Lens.Internal.Reflection: instance Typeable T212
- Control.Lens.Internal.Reflection: instance Typeable T213
- Control.Lens.Internal.Reflection: instance Typeable T214
- Control.Lens.Internal.Reflection: instance Typeable T215
- Control.Lens.Internal.Reflection: instance Typeable T216
- Control.Lens.Internal.Reflection: instance Typeable T217
- Control.Lens.Internal.Reflection: instance Typeable T218
- Control.Lens.Internal.Reflection: instance Typeable T219
- Control.Lens.Internal.Reflection: instance Typeable T22
- Control.Lens.Internal.Reflection: instance Typeable T220
- Control.Lens.Internal.Reflection: instance Typeable T221
- Control.Lens.Internal.Reflection: instance Typeable T222
- Control.Lens.Internal.Reflection: instance Typeable T223
- Control.Lens.Internal.Reflection: instance Typeable T224
- Control.Lens.Internal.Reflection: instance Typeable T225
- Control.Lens.Internal.Reflection: instance Typeable T226
- Control.Lens.Internal.Reflection: instance Typeable T227
- Control.Lens.Internal.Reflection: instance Typeable T228
- Control.Lens.Internal.Reflection: instance Typeable T229
- Control.Lens.Internal.Reflection: instance Typeable T23
- Control.Lens.Internal.Reflection: instance Typeable T230
- Control.Lens.Internal.Reflection: instance Typeable T231
- Control.Lens.Internal.Reflection: instance Typeable T232
- Control.Lens.Internal.Reflection: instance Typeable T233
- Control.Lens.Internal.Reflection: instance Typeable T234
- Control.Lens.Internal.Reflection: instance Typeable T235
- Control.Lens.Internal.Reflection: instance Typeable T236
- Control.Lens.Internal.Reflection: instance Typeable T237
- Control.Lens.Internal.Reflection: instance Typeable T238
- Control.Lens.Internal.Reflection: instance Typeable T239
- Control.Lens.Internal.Reflection: instance Typeable T24
- Control.Lens.Internal.Reflection: instance Typeable T240
- Control.Lens.Internal.Reflection: instance Typeable T241
- Control.Lens.Internal.Reflection: instance Typeable T242
- Control.Lens.Internal.Reflection: instance Typeable T243
- Control.Lens.Internal.Reflection: instance Typeable T244
- Control.Lens.Internal.Reflection: instance Typeable T245
- Control.Lens.Internal.Reflection: instance Typeable T246
- Control.Lens.Internal.Reflection: instance Typeable T247
- Control.Lens.Internal.Reflection: instance Typeable T248
- Control.Lens.Internal.Reflection: instance Typeable T249
- Control.Lens.Internal.Reflection: instance Typeable T25
- Control.Lens.Internal.Reflection: instance Typeable T250
- Control.Lens.Internal.Reflection: instance Typeable T251
- Control.Lens.Internal.Reflection: instance Typeable T252
- Control.Lens.Internal.Reflection: instance Typeable T253
- Control.Lens.Internal.Reflection: instance Typeable T254
- Control.Lens.Internal.Reflection: instance Typeable T255
- Control.Lens.Internal.Reflection: instance Typeable T26
- Control.Lens.Internal.Reflection: instance Typeable T27
- Control.Lens.Internal.Reflection: instance Typeable T28
- Control.Lens.Internal.Reflection: instance Typeable T29
- Control.Lens.Internal.Reflection: instance Typeable T3
- Control.Lens.Internal.Reflection: instance Typeable T30
- Control.Lens.Internal.Reflection: instance Typeable T31
- Control.Lens.Internal.Reflection: instance Typeable T32
- Control.Lens.Internal.Reflection: instance Typeable T33
- Control.Lens.Internal.Reflection: instance Typeable T34
- Control.Lens.Internal.Reflection: instance Typeable T35
- Control.Lens.Internal.Reflection: instance Typeable T36
- Control.Lens.Internal.Reflection: instance Typeable T37
- Control.Lens.Internal.Reflection: instance Typeable T38
- Control.Lens.Internal.Reflection: instance Typeable T39
- Control.Lens.Internal.Reflection: instance Typeable T4
- Control.Lens.Internal.Reflection: instance Typeable T40
- Control.Lens.Internal.Reflection: instance Typeable T41
- Control.Lens.Internal.Reflection: instance Typeable T42
- Control.Lens.Internal.Reflection: instance Typeable T43
- Control.Lens.Internal.Reflection: instance Typeable T44
- Control.Lens.Internal.Reflection: instance Typeable T45
- Control.Lens.Internal.Reflection: instance Typeable T46
- Control.Lens.Internal.Reflection: instance Typeable T47
- Control.Lens.Internal.Reflection: instance Typeable T48
- Control.Lens.Internal.Reflection: instance Typeable T49
- Control.Lens.Internal.Reflection: instance Typeable T5
- Control.Lens.Internal.Reflection: instance Typeable T50
- Control.Lens.Internal.Reflection: instance Typeable T51
- Control.Lens.Internal.Reflection: instance Typeable T52
- Control.Lens.Internal.Reflection: instance Typeable T53
- Control.Lens.Internal.Reflection: instance Typeable T54
- Control.Lens.Internal.Reflection: instance Typeable T55
- Control.Lens.Internal.Reflection: instance Typeable T56
- Control.Lens.Internal.Reflection: instance Typeable T57
- Control.Lens.Internal.Reflection: instance Typeable T58
- Control.Lens.Internal.Reflection: instance Typeable T59
- Control.Lens.Internal.Reflection: instance Typeable T6
- Control.Lens.Internal.Reflection: instance Typeable T60
- Control.Lens.Internal.Reflection: instance Typeable T61
- Control.Lens.Internal.Reflection: instance Typeable T62
- Control.Lens.Internal.Reflection: instance Typeable T63
- Control.Lens.Internal.Reflection: instance Typeable T64
- Control.Lens.Internal.Reflection: instance Typeable T65
- Control.Lens.Internal.Reflection: instance Typeable T66
- Control.Lens.Internal.Reflection: instance Typeable T67
- Control.Lens.Internal.Reflection: instance Typeable T68
- Control.Lens.Internal.Reflection: instance Typeable T69
- Control.Lens.Internal.Reflection: instance Typeable T7
- Control.Lens.Internal.Reflection: instance Typeable T70
- Control.Lens.Internal.Reflection: instance Typeable T71
- Control.Lens.Internal.Reflection: instance Typeable T72
- Control.Lens.Internal.Reflection: instance Typeable T73
- Control.Lens.Internal.Reflection: instance Typeable T74
- Control.Lens.Internal.Reflection: instance Typeable T75
- Control.Lens.Internal.Reflection: instance Typeable T76
- Control.Lens.Internal.Reflection: instance Typeable T77
- Control.Lens.Internal.Reflection: instance Typeable T78
- Control.Lens.Internal.Reflection: instance Typeable T79
- Control.Lens.Internal.Reflection: instance Typeable T8
- Control.Lens.Internal.Reflection: instance Typeable T80
- Control.Lens.Internal.Reflection: instance Typeable T81
- Control.Lens.Internal.Reflection: instance Typeable T82
- Control.Lens.Internal.Reflection: instance Typeable T83
- Control.Lens.Internal.Reflection: instance Typeable T84
- Control.Lens.Internal.Reflection: instance Typeable T85
- Control.Lens.Internal.Reflection: instance Typeable T86
- Control.Lens.Internal.Reflection: instance Typeable T87
- Control.Lens.Internal.Reflection: instance Typeable T88
- Control.Lens.Internal.Reflection: instance Typeable T89
- Control.Lens.Internal.Reflection: instance Typeable T9
- Control.Lens.Internal.Reflection: instance Typeable T90
- Control.Lens.Internal.Reflection: instance Typeable T91
- Control.Lens.Internal.Reflection: instance Typeable T92
- Control.Lens.Internal.Reflection: instance Typeable T93
- Control.Lens.Internal.Reflection: instance Typeable T94
- Control.Lens.Internal.Reflection: instance Typeable T95
- Control.Lens.Internal.Reflection: instance Typeable T96
- Control.Lens.Internal.Reflection: instance Typeable T97
- Control.Lens.Internal.Reflection: instance Typeable T98
- Control.Lens.Internal.Reflection: instance Typeable T99
- Control.Lens.Internal.Reflection: instance Typeable W
- Control.Lens.Internal.Zoom: Effect :: m r -> Effect m r a
- Control.Lens.Internal.Zoom: EffectRWS :: (st -> m (s, st, w)) -> EffectRWS w st m s a
- Control.Lens.Internal.Zoom: Err :: Either e a -> Err e a
- Control.Lens.Internal.Zoom: Focusing :: m (s, a) -> Focusing m s a
- Control.Lens.Internal.Zoom: FocusingErr :: k (Err e s) a -> FocusingErr e k s a
- Control.Lens.Internal.Zoom: FocusingMay :: k (May s) a -> FocusingMay k s a
- Control.Lens.Internal.Zoom: FocusingOn :: k (f s) a -> FocusingOn f k s a
- Control.Lens.Internal.Zoom: FocusingPlus :: k (s, w) a -> FocusingPlus w k s a
- Control.Lens.Internal.Zoom: FocusingWith :: m (s, a, w) -> FocusingWith w m s a
- Control.Lens.Internal.Zoom: May :: Maybe a -> May a
- Control.Lens.Internal.Zoom: getEffect :: Effect m r a -> m r
- Control.Lens.Internal.Zoom: getEffectRWS :: EffectRWS w st m s a -> st -> m (s, st, w)
- Control.Lens.Internal.Zoom: getErr :: Err e a -> Either e a
- Control.Lens.Internal.Zoom: getMay :: May a -> Maybe a
- Control.Lens.Internal.Zoom: unfocusing :: Focusing m s a -> m (s, a)
- Control.Lens.Internal.Zoom: unfocusingErr :: FocusingErr e k s a -> k (Err e s) a
- Control.Lens.Internal.Zoom: unfocusingMay :: FocusingMay k s a -> k (May s) a
- Control.Lens.Internal.Zoom: unfocusingOn :: FocusingOn f k s a -> k (f s) a
- Control.Lens.Internal.Zoom: unfocusingPlus :: FocusingPlus w k s a -> k (s, w) a
- Control.Lens.Internal.Zoom: unfocusingWith :: FocusingWith w m s a -> m (s, a, w)
- Control.Lens.Lens: Context :: (b -> t) -> a -> Context a b t
- Control.Lens.Loupe: (#%%=) :: MonadState s m => ALens s s a b -> (a -> (r, b)) -> m r
- Control.Lens.Loupe: (#%%~) :: Functor f => ALens s t a b -> (a -> f b) -> s -> f t
- Control.Lens.Loupe: (#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m ()
- Control.Lens.Loupe: (#%~) :: ALens s t a b -> (a -> b) -> s -> t
- Control.Lens.Loupe: (#=) :: MonadState s m => ALens s s a b -> b -> m ()
- Control.Lens.Loupe: (#~) :: ALens s t a b -> b -> s -> t
- Control.Lens.Loupe: (<#%=) :: MonadState s m => ALens s s a b -> (a -> b) -> m b
- Control.Lens.Loupe: (<#%~) :: ALens s t a b -> (a -> b) -> s -> (b, t)
- Control.Lens.Loupe: (<#=) :: MonadState s m => ALens s s a b -> b -> m b
- Control.Lens.Loupe: (<#~) :: ALens s t a b -> b -> s -> (b, t)
- Control.Lens.Loupe: (^#) :: s -> ALens s t a b -> a
- Control.Lens.Loupe: cloneLens :: ALens s t a b -> Lens s t a b
- Control.Lens.Loupe: storing :: ALens s t a b -> b -> s -> t
- Control.Lens.Loupe: type ALens s t a b = LensLike (Pretext (->) a b) s t a b
- Control.Lens.Loupe: type ALens' s a = ALens s s a a
- Control.Lens.Loupe: type Loupe s t a b = LensLike (Pretext (->) a b) s t a b
- Control.Lens.Loupe: type SimpleLoupe s a = Loupe s s a a
- Control.Lens.Reified: Fold :: Fold s a -> ReifiedFold s a
- Control.Lens.Reified: Getter :: Getter s a -> ReifiedGetter s a
- Control.Lens.Reified: IndexedFold :: IndexedFold i s a -> ReifiedIndexedFold i s a
- Control.Lens.Reified: IndexedGetter :: IndexedGetter i s a -> ReifiedIndexedGetter i s a
- Control.Lens.Reified: IndexedLens :: IndexedLens i s t a b -> ReifiedIndexedLens i s t a b
- Control.Lens.Reified: IndexedSetter :: IndexedSetter i s t a b -> ReifiedIndexedSetter i s t a b
- Control.Lens.Reified: IndexedTraversal :: IndexedTraversal i s t a b -> ReifiedIndexedTraversal i s t a b
- Control.Lens.Reified: Iso :: Iso s t a b -> ReifiedIso s t a b
- Control.Lens.Reified: Lens :: Lens s t a b -> ReifiedLens s t a b
- Control.Lens.Reified: Prism :: Prism s t a b -> ReifiedPrism s t a b
- Control.Lens.Reified: Setter :: Setter s t a b -> ReifiedSetter s t a b
- Control.Lens.Reified: Traversal :: Traversal s t a b -> ReifiedTraversal s t a b
- Control.Lens.Reified: runFold :: ReifiedFold s a -> Fold s a
- Control.Lens.Reified: runGetter :: ReifiedGetter s a -> Getter s a
- Control.Lens.Reified: runIndexedFold :: ReifiedIndexedFold i s a -> IndexedFold i s a
- Control.Lens.Reified: runIndexedGetter :: ReifiedIndexedGetter i s a -> IndexedGetter i s a
- Control.Lens.Reified: runIndexedLens :: ReifiedIndexedLens i s t a b -> IndexedLens i s t a b
- Control.Lens.Reified: runIndexedSetter :: ReifiedIndexedSetter i s t a b -> IndexedSetter i s t a b
- Control.Lens.Reified: runIndexedTraversal :: ReifiedIndexedTraversal i s t a b -> IndexedTraversal i s t a b
- Control.Lens.Reified: runIso :: ReifiedIso s t a b -> Iso s t a b
- Control.Lens.Reified: runLens :: ReifiedLens s t a b -> Lens s t a b
- Control.Lens.Reified: runPrism :: ReifiedPrism s t a b -> Prism s t a b
- Control.Lens.Reified: runSetter :: ReifiedSetter s t a b -> Setter s t a b
- Control.Lens.Reified: runTraversal :: ReifiedTraversal s t a b -> Traversal s t a b
- Control.Lens.Setter: Identity :: a -> Identity a
- Control.Lens.Setter: runIdentity :: Identity a -> a
- Control.Lens.TH: MethodName :: Name -> Name -> DefName
- Control.Lens.TH: TopName :: Name -> DefName
- Control.Lens.TH: makeFieldsWith :: LensRules -> Name -> DecsQ
- Control.Lens.Traversal: Bazaar :: (forall f. Applicative f => p a (f b) -> f t) -> Bazaar p a b t
- Control.Lens.Traversal: Bazaar1 :: (forall f. Apply f => p a (f b) -> f t) -> Bazaar1 p a b t
- Control.Lens.Traversal: runBazaar :: Bazaar p a b t -> forall f. Applicative f => p a (f b) -> f t
- Control.Lens.Traversal: runBazaar1 :: Bazaar1 p a b t -> forall f. Apply f => p a (f b) -> f t
- Control.Lens.Wrapped: instance Wrapped (Tagged s a)
- Control.Lens.Wrapped: instance t ~ All => Rewrapped All t
- Control.Lens.Wrapped: instance t ~ Any => Rewrapped Any t
- Control.Lens.Wrapped: instance t ~ AssertionFailed => Rewrapped AssertionFailed t
- Control.Lens.Wrapped: instance t ~ Backwards g b => Rewrapped (Backwards f a) t
- Control.Lens.Wrapped: instance t ~ Comparison b => Rewrapped (Comparison a) t
- Control.Lens.Wrapped: instance t ~ Compose f' g' a' => Rewrapped (Compose f g a) t
- Control.Lens.Wrapped: instance t ~ ComposeCF f' g' a' => Rewrapped (ComposeCF f g a) t
- Control.Lens.Wrapped: instance t ~ ComposeFC f' g' a' => Rewrapped (ComposeFC f g a) t
- Control.Lens.Wrapped: instance t ~ Const a' x' => Rewrapped (Const a x) t
- Control.Lens.Wrapped: instance t ~ Constant a' b' => Rewrapped (Constant a b) t
- Control.Lens.Wrapped: instance t ~ ContT r' m' a' => Rewrapped (ContT r m a) t
- Control.Lens.Wrapped: instance t ~ Coproduct f' g' a' => Rewrapped (Coproduct f g a) t
- Control.Lens.Wrapped: instance t ~ Dual b => Rewrapped (Dual a) t
- Control.Lens.Wrapped: instance t ~ Endo b => Rewrapped (Endo b) t
- Control.Lens.Wrapped: instance t ~ Equivalence b => Rewrapped (Equivalence a) t
- Control.Lens.Wrapped: instance t ~ ErrorCall => Rewrapped ErrorCall t
- Control.Lens.Wrapped: instance t ~ ErrorT e' m' a' => Rewrapped (ErrorT e m a) t
- Control.Lens.Wrapped: instance t ~ First b => Rewrapped (First a) t
- Control.Lens.Wrapped: instance t ~ Identity b => Rewrapped (Identity a) t
- Control.Lens.Wrapped: instance t ~ IdentityT n b => Rewrapped (IdentityT m a) t
- Control.Lens.Wrapped: instance t ~ IntMap a' => Rewrapped (IntMap a) t
- Control.Lens.Wrapped: instance t ~ IntSet => Rewrapped IntSet t
- Control.Lens.Wrapped: instance t ~ Kleisli m' a' b' => Rewrapped (Kleisli m a b) t
- Control.Lens.Wrapped: instance t ~ Last b => Rewrapped (Last a) t
- Control.Lens.Wrapped: instance t ~ Last b => Rewrapped (Last b) t
- Control.Lens.Wrapped: instance t ~ ListT n b => Rewrapped (ListT m a) t
- Control.Lens.Wrapped: instance t ~ Max b => Rewrapped (Max a) t
- Control.Lens.Wrapped: instance t ~ MaybeT n b => Rewrapped (MaybeT m a) t
- Control.Lens.Wrapped: instance t ~ Min b => Rewrapped (Min a) t
- Control.Lens.Wrapped: instance t ~ NoMethodError => Rewrapped NoMethodError t
- Control.Lens.Wrapped: instance t ~ Op a' b' => Rewrapped (Op a b) t
- Control.Lens.Wrapped: instance t ~ Option b => Rewrapped (Option a) t
- Control.Lens.Wrapped: instance t ~ PatternMatchFail => Rewrapped PatternMatchFail t
- Control.Lens.Wrapped: instance t ~ Predicate b => Rewrapped (Predicate a) t
- Control.Lens.Wrapped: instance t ~ Product b => Rewrapped (Product a) t
- Control.Lens.Wrapped: instance t ~ RWST r' w' s' m' a' => Rewrapped (RWST r w s m a) t
- Control.Lens.Wrapped: instance t ~ ReaderT r n b => Rewrapped (ReaderT r m a) t
- Control.Lens.Wrapped: instance t ~ RecConError => Rewrapped RecConError t
- Control.Lens.Wrapped: instance t ~ RecSelError => Rewrapped RecSelError t
- Control.Lens.Wrapped: instance t ~ RecUpdError => Rewrapped RecUpdError t
- Control.Lens.Wrapped: instance t ~ Reverse g b => Rewrapped (Reverse f a) t
- Control.Lens.Wrapped: instance t ~ Seq a' => Rewrapped (Seq a) t
- Control.Lens.Wrapped: instance t ~ StateT s' m' a' => Rewrapped (StateT s m a) t
- Control.Lens.Wrapped: instance t ~ Sum b => Rewrapped (Sum a) t
- Control.Lens.Wrapped: instance t ~ Tagged s' a' => Rewrapped (Tagged s a) t
- Control.Lens.Wrapped: instance t ~ TracedT m' w' a' => Rewrapped (TracedT m w a) t
- Control.Lens.Wrapped: instance t ~ Vector a' => Rewrapped (Vector a) t
- Control.Lens.Wrapped: instance t ~ WrappedArrow a' b' c' => Rewrapped (WrappedArrow a b c) t
- Control.Lens.Wrapped: instance t ~ WrappedMonad m' a' => Rewrapped (WrappedMonad m a) t
- Control.Lens.Wrapped: instance t ~ WrappedMonoid b => Rewrapped (WrappedMonoid a) t
- Control.Lens.Wrapped: instance t ~ WriterT w' m' a' => Rewrapped (WriterT w m a) t
- Control.Lens.Wrapped: instance t ~ ZipList b => Rewrapped (ZipList a) t
- Control.Monad.Error.Lens: Handler :: (e -> Maybe a) -> (a -> m r) -> Handler e m r
- Data.Data.Lens: instance Typeable FieldException
- Data.List.Lens: strippingPrefix :: Eq a => [a] -> Prism' [a] [a]
- Data.List.Lens: strippingSuffix :: Eq a => [a] -> Prism' [a] [a]
- Data.List.Split.Lens: chunking :: Int -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: condensing :: Lens' (Splitter a) CondensePolicy
- Data.List.Split.Lens: delimiters :: Lens (Splitter a) (Splitter b) [a -> Bool] [b -> Bool]
- Data.List.Split.Lens: delimiting :: Lens' (Splitter a) DelimPolicy
- Data.List.Split.Lens: endingBy :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: endingByOneOf :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: keepFinalBlanks :: Lens' (Splitter a) Bool
- Data.List.Split.Lens: keepInitialBlanks :: Lens' (Splitter a) Bool
- Data.List.Split.Lens: liningBy :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splitting :: Splitter a -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splittingOn :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splittingOneOf :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splittingPlaces :: Integral n => [n] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splittingPlacesBlanks :: Integral n => [n] -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: splittingWhen :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]
- Data.List.Split.Lens: wordingBy :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]
- Language.Haskell.TH.Lens: _ClassP :: Prism' Pred (Name, [Type])
- Language.Haskell.TH.Lens: _EqualP :: Prism' Pred (Type, Type)
- Language.Haskell.TH.Lens: instance HasTypeVars Pred
- Language.Haskell.TH.Lens: instance SubstType Pred
+ Control.Lens.At: instance (a ~ a2) => Ixed (a, a2)
+ Control.Lens.Cons: instance (a ~ b) => Cons (NonEmpty a) (NonEmpty b) a b
+ Control.Lens.Cons: instance (a ~ b) => Snoc (NonEmpty a) (NonEmpty b) a b
+ Control.Lens.Each: instance (c ~ d) => Each (HashMap c a) (HashMap d b) a b
+ Control.Lens.Each: instance (c ~ d) => Each (Map c a) (Map d b) a b
+ Control.Lens.Equality: [Identical] :: Identical a b a b
+ Control.Lens.Getter: [Const] :: a -> Const a b
+ Control.Lens.Getter: [getConst] :: Const a b -> a
+ Control.Lens.Getter: ilike :: (Indexable i p, Contravariant f) => i -> a -> Optical' p (->) f s a
+ Control.Lens.Getter: like :: (Profunctor p, Contravariant f) => a -> Optical' p p f s a
+ Control.Lens.Indexed: [Indexed] :: (i -> a -> b) -> Indexed i a b
+ Control.Lens.Indexed: [runIndexed] :: Indexed i a b -> i -> a -> b
+ Control.Lens.Internal.Bazaar: [Bazaar1] :: (forall f. Apply f => p a (f b) -> f t) -> Bazaar1 p a b t
+ Control.Lens.Internal.Bazaar: [BazaarT1] :: (forall f. Apply f => p a (f b) -> f t) -> BazaarT1 p a b t
+ Control.Lens.Internal.Bazaar: [BazaarT] :: (forall f. Applicative f => p a (f b) -> f t) -> BazaarT p a b t
+ Control.Lens.Internal.Bazaar: [Bazaar] :: (forall f. Applicative f => p a (f b) -> f t) -> Bazaar p a b t
+ Control.Lens.Internal.Bazaar: [runBazaar1] :: Bazaar1 p a b t -> forall f. Apply f => p a (f b) -> f t
+ Control.Lens.Internal.Bazaar: [runBazaarT1] :: BazaarT1 p a b t -> forall f. Apply f => p a (f b) -> f t
+ Control.Lens.Internal.Bazaar: [runBazaarT] :: BazaarT p a b t -> forall f. Applicative f => p a (f b) -> f t
+ Control.Lens.Internal.Bazaar: [runBazaar] :: Bazaar p a b t -> forall f. Applicative f => p a (f b) -> f t
+ Control.Lens.Internal.Coerce: coerce :: Coercible * a b => a -> b
+ Control.Lens.Internal.Coerce: coerce' :: Coercible a b => b -> a
+ Control.Lens.Internal.Context: [Context] :: (b -> t) -> a -> Context a b t
+ Control.Lens.Internal.Context: [PretextT] :: (forall f. Functor f => p a (f b) -> f t) -> PretextT p a b t
+ Control.Lens.Internal.Context: [Pretext] :: (forall f. Functor f => p a (f b) -> f t) -> Pretext p a b t
+ Control.Lens.Internal.Context: [runPretextT] :: PretextT p a b t -> forall f. Functor f => p a (f b) -> f t
+ Control.Lens.Internal.Context: [runPretext] :: Pretext p a b t -> forall f. Functor f => p a (f b) -> f t
+ Control.Lens.Internal.Context: instance (a ~ b) => Comonad (Context a b)
+ Control.Lens.Internal.Context: instance (a ~ b) => ComonadStore a (Context a b)
+ Control.Lens.Internal.Deque: [BD] :: !Int -> [a] -> !Int -> [a] -> Deque a
+ Control.Lens.Internal.Exception: [HandlingException] :: HandlingException
+ Control.Lens.Internal.Exception: instance forall (k :: BOX) a (s :: k) (m :: * -> *). (Reifies s (SomeException -> Maybe a), Typeable (Handling a s m)) => Exception (Handling a s m)
+ Control.Lens.Internal.Exception: instance forall (k :: BOX) a (s :: k) (m :: * -> *). Show (Handling a s m)
+ Control.Lens.Internal.FieldTH: [LensRules] :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> (Name -> [Name] -> Name -> [DefName]) -> (Name -> Maybe (Name, Name)) -> LensRules
+ Control.Lens.Internal.FieldTH: [MethodName] :: Name -> Name -> DefName
+ Control.Lens.Internal.FieldTH: [TopName] :: Name -> DefName
+ Control.Lens.Internal.FieldTH: [_allowIsos] :: LensRules -> Bool
+ Control.Lens.Internal.FieldTH: [_allowUpdates] :: LensRules -> Bool
+ Control.Lens.Internal.FieldTH: [_classyLenses] :: LensRules -> Name -> Maybe (Name, Name)
+ Control.Lens.Internal.FieldTH: [_fieldToDef] :: LensRules -> Name -> [Name] -> Name -> [DefName]
+ Control.Lens.Internal.FieldTH: [_generateClasses] :: LensRules -> Bool
+ Control.Lens.Internal.FieldTH: [_generateSigs] :: LensRules -> Bool
+ Control.Lens.Internal.FieldTH: [_lazyPatterns] :: LensRules -> Bool
+ Control.Lens.Internal.FieldTH: [_simpleLenses] :: LensRules -> Bool
+ Control.Lens.Internal.Fold: [Folding] :: f a -> Folding f a
+ Control.Lens.Internal.Fold: [LLeaf] :: a -> Leftmost a
+ Control.Lens.Internal.Fold: [LPure] :: Leftmost a
+ Control.Lens.Internal.Fold: [LStep] :: (Leftmost a) -> Leftmost a
+ Control.Lens.Internal.Fold: [M] :: a -> M a s
+ Control.Lens.Internal.Fold: [Max] :: a -> Max a
+ Control.Lens.Internal.Fold: [Min] :: a -> Min a
+ Control.Lens.Internal.Fold: [NoMax] :: Max a
+ Control.Lens.Internal.Fold: [NoMin] :: Min a
+ Control.Lens.Internal.Fold: [RLeaf] :: a -> Rightmost a
+ Control.Lens.Internal.Fold: [RPure] :: Rightmost a
+ Control.Lens.Internal.Fold: [RStep] :: (Rightmost a) -> Rightmost a
+ Control.Lens.Internal.Fold: [ReifiedMonoid] :: (a -> a -> a) -> a -> ReifiedMonoid a
+ Control.Lens.Internal.Fold: [Sequenced] :: m a -> Sequenced a m
+ Control.Lens.Internal.Fold: [Traversed] :: f a -> Traversed a f
+ Control.Lens.Internal.Fold: [getFolding] :: Folding f a -> f a
+ Control.Lens.Internal.Fold: [getSequenced] :: Sequenced a m -> m a
+ Control.Lens.Internal.Fold: [getTraversed] :: Traversed a f -> f a
+ Control.Lens.Internal.Fold: [reifiedMappend] :: ReifiedMonoid a -> a -> a -> a
+ Control.Lens.Internal.Fold: [reifiedMempty] :: ReifiedMonoid a -> a
+ Control.Lens.Internal.Getter: [AlongsideLeft] :: f (a, b) -> AlongsideLeft f b a
+ Control.Lens.Internal.Getter: [AlongsideRight] :: f (a, b) -> AlongsideRight f a b
+ Control.Lens.Internal.Getter: [getAlongsideLeft] :: AlongsideLeft f b a -> f (a, b)
+ Control.Lens.Internal.Getter: [getAlongsideRight] :: AlongsideRight f a b -> f (a, b)
+ Control.Lens.Internal.Indexed: [Indexed] :: (i -> a -> b) -> Indexed i a b
+ Control.Lens.Internal.Indexed: [Indexing64] :: (Int64 -> (Int64, f a)) -> Indexing64 f a
+ Control.Lens.Internal.Indexed: [Indexing] :: (Int -> (Int, f a)) -> Indexing f a
+ Control.Lens.Internal.Indexed: [runIndexed] :: Indexed i a b -> i -> a -> b
+ Control.Lens.Internal.Indexed: [runIndexing64] :: Indexing64 f a -> Int64 -> (Int64, f a)
+ Control.Lens.Internal.Indexed: [runIndexing] :: Indexing f a -> Int -> (Int, f a)
+ Control.Lens.Internal.Indexed: instance (i ~ j) => Indexable i (Indexed j)
+ Control.Lens.Internal.Iso: [Exchange] :: (s -> a) -> (b -> t) -> Exchange a b s t
+ Control.Lens.Internal.Level: [Deepening] :: (forall r. Int -> (Level i a -> Bool -> r) -> r) -> Deepening i a
+ Control.Lens.Internal.Level: [Flows] :: ([Level i b] -> a) -> Flows i b a
+ Control.Lens.Internal.Level: [One] :: i -> a -> Level i a
+ Control.Lens.Internal.Level: [Two] :: {-# UNPACK #-} !Word -> !(Level i a) -> !(Level i a) -> Level i a
+ Control.Lens.Internal.Level: [Zero] :: Level i a
+ Control.Lens.Internal.Level: [runDeepening] :: Deepening i a -> forall r. Int -> (Level i a -> Bool -> r) -> r
+ Control.Lens.Internal.Level: [runFlows] :: Flows i b a -> [Level i b] -> a
+ Control.Lens.Internal.List: ordinalNub :: Int -> [Int] -> [Int]
+ Control.Lens.Internal.Magma: [Mafic] :: Int -> (Int -> Magma Int t b a) -> Mafic a b t
+ Control.Lens.Internal.Magma: [MagmaAp] :: Magma i (x -> y) b a -> Magma i x b a -> Magma i y b a
+ Control.Lens.Internal.Magma: [MagmaFmap] :: (x -> y) -> Magma i x b a -> Magma i y b a
+ Control.Lens.Internal.Magma: [MagmaPure] :: x -> Magma i x b a
+ Control.Lens.Internal.Magma: [Magma] :: i -> a -> Magma i b b a
+ Control.Lens.Internal.Magma: [Molten] :: Magma i t b a -> Molten i a b t
+ Control.Lens.Internal.Magma: [TakingWhile] :: Bool -> t -> (Bool -> Magma () t b (Corep p a)) -> TakingWhile p a b t
+ Control.Lens.Internal.Magma: [runMolten] :: Molten i a b t -> Magma i t b a
+ Control.Lens.Internal.Magma: instance (a ~ b) => Comonad (Molten i a b)
+ Control.Lens.Internal.Prism: [Market] :: (b -> t) -> (s -> Either t a) -> Market a b s t
+ Control.Lens.Internal.Zoom: [EffectRWS] :: (st -> m (s, st, w)) -> EffectRWS w st m s a
+ Control.Lens.Internal.Zoom: [Effect] :: m r -> Effect m r a
+ Control.Lens.Internal.Zoom: [Err] :: Either e a -> Err e a
+ Control.Lens.Internal.Zoom: [FocusingErr] :: k (Err e s) a -> FocusingErr e k s a
+ Control.Lens.Internal.Zoom: [FocusingMay] :: k (May s) a -> FocusingMay k s a
+ Control.Lens.Internal.Zoom: [FocusingOn] :: k (f s) a -> FocusingOn f k s a
+ Control.Lens.Internal.Zoom: [FocusingPlus] :: k (s, w) a -> FocusingPlus w k s a
+ Control.Lens.Internal.Zoom: [FocusingWith] :: m (s, a, w) -> FocusingWith w m s a
+ Control.Lens.Internal.Zoom: [Focusing] :: m (s, a) -> Focusing m s a
+ Control.Lens.Internal.Zoom: [May] :: Maybe a -> May a
+ Control.Lens.Internal.Zoom: [getEffectRWS] :: EffectRWS w st m s a -> st -> m (s, st, w)
+ Control.Lens.Internal.Zoom: [getEffect] :: Effect m r a -> m r
+ Control.Lens.Internal.Zoom: [getErr] :: Err e a -> Either e a
+ Control.Lens.Internal.Zoom: [getMay] :: May a -> Maybe a
+ Control.Lens.Internal.Zoom: [unfocusingErr] :: FocusingErr e k s a -> k (Err e s) a
+ Control.Lens.Internal.Zoom: [unfocusingMay] :: FocusingMay k s a -> k (May s) a
+ Control.Lens.Internal.Zoom: [unfocusingOn] :: FocusingOn f k s a -> k (f s) a
+ Control.Lens.Internal.Zoom: [unfocusingPlus] :: FocusingPlus w k s a -> k (s, w) a
+ Control.Lens.Internal.Zoom: [unfocusingWith] :: FocusingWith w m s a -> m (s, a, w)
+ Control.Lens.Internal.Zoom: [unfocusing] :: Focusing m s a -> m (s, a)
+ Control.Lens.Lens: [Context] :: (b -> t) -> a -> Context a b t
+ Control.Lens.Lens: fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b
+ Control.Lens.Plated: class GPlated a g
+ Control.Lens.Plated: gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a
+ Control.Lens.Plated: instance (GPlated a f, GPlated a g) => GPlated a (f :*: g)
+ Control.Lens.Plated: instance (GPlated a f, GPlated a g) => GPlated a (f :+: g)
+ Control.Lens.Plated: instance GPlated a (K1 i b)
+ Control.Lens.Plated: instance GPlated a U1
+ Control.Lens.Plated: instance GPlated a V1
+ Control.Lens.Plated: instance GPlated a f => GPlated a (M1 i c f)
+ Control.Lens.Plated: instance [overlapping] GPlated a (K1 i a)
+ Control.Lens.Reified: [Fold] :: Fold s a -> ReifiedFold s a
+ Control.Lens.Reified: [Getter] :: Getter s a -> ReifiedGetter s a
+ Control.Lens.Reified: [IndexedFold] :: IndexedFold i s a -> ReifiedIndexedFold i s a
+ Control.Lens.Reified: [IndexedGetter] :: IndexedGetter i s a -> ReifiedIndexedGetter i s a
+ Control.Lens.Reified: [IndexedLens] :: IndexedLens i s t a b -> ReifiedIndexedLens i s t a b
+ Control.Lens.Reified: [IndexedSetter] :: IndexedSetter i s t a b -> ReifiedIndexedSetter i s t a b
+ Control.Lens.Reified: [IndexedTraversal] :: IndexedTraversal i s t a b -> ReifiedIndexedTraversal i s t a b
+ Control.Lens.Reified: [Iso] :: Iso s t a b -> ReifiedIso s t a b
+ Control.Lens.Reified: [Lens] :: Lens s t a b -> ReifiedLens s t a b
+ Control.Lens.Reified: [Prism] :: Prism s t a b -> ReifiedPrism s t a b
+ Control.Lens.Reified: [Setter] :: Setter s t a b -> ReifiedSetter s t a b
+ Control.Lens.Reified: [Traversal] :: Traversal s t a b -> ReifiedTraversal s t a b
+ Control.Lens.Reified: [runFold] :: ReifiedFold s a -> Fold s a
+ Control.Lens.Reified: [runGetter] :: ReifiedGetter s a -> Getter s a
+ Control.Lens.Reified: [runIndexedFold] :: ReifiedIndexedFold i s a -> IndexedFold i s a
+ Control.Lens.Reified: [runIndexedGetter] :: ReifiedIndexedGetter i s a -> IndexedGetter i s a
+ Control.Lens.Reified: [runIndexedLens] :: ReifiedIndexedLens i s t a b -> IndexedLens i s t a b
+ Control.Lens.Reified: [runIndexedSetter] :: ReifiedIndexedSetter i s t a b -> IndexedSetter i s t a b
+ Control.Lens.Reified: [runIndexedTraversal] :: ReifiedIndexedTraversal i s t a b -> IndexedTraversal i s t a b
+ Control.Lens.Reified: [runIso] :: ReifiedIso s t a b -> Iso s t a b
+ Control.Lens.Reified: [runLens] :: ReifiedLens s t a b -> Lens s t a b
+ Control.Lens.Reified: [runPrism] :: ReifiedPrism s t a b -> Prism s t a b
+ Control.Lens.Reified: [runSetter] :: ReifiedSetter s t a b -> Setter s t a b
+ Control.Lens.Reified: [runTraversal] :: ReifiedTraversal s t a b -> Traversal s t a b
+ Control.Lens.Setter: (.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m ()
+ Control.Lens.Setter: (.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t
+ Control.Lens.Setter: [Identity] :: a -> Identity a
+ Control.Lens.Setter: [runIdentity] :: Identity a -> a
+ Control.Lens.Setter: iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t
+ Control.Lens.TH: [MethodName] :: Name -> Name -> DefName
+ Control.Lens.TH: [TopName] :: Name -> DefName
+ Control.Lens.TH: generateLazyPatterns :: Lens' LensRules Bool
+ Control.Lens.Traversal: [Bazaar1] :: (forall f. Apply f => p a (f b) -> f t) -> Bazaar1 p a b t
+ Control.Lens.Traversal: [Bazaar] :: (forall f. Applicative f => p a (f b) -> f t) -> Bazaar p a b t
+ Control.Lens.Traversal: [runBazaar1] :: Bazaar1 p a b t -> forall f. Apply f => p a (f b) -> f t
+ Control.Lens.Traversal: [runBazaar] :: Bazaar p a b t -> forall f. Applicative f => p a (f b) -> f t
+ Control.Lens.Traversal: confusing :: Applicative f => LensLike (Rift (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b
+ Control.Lens.Tuple: _1' :: Field1 s t a b => Lens s t a b
+ Control.Lens.Tuple: _2' :: Field2 s t a b => Lens s t a b
+ Control.Lens.Tuple: _3' :: Field3 s t a b => Lens s t a b
+ Control.Lens.Tuple: _4' :: Field4 s t a b => Lens s t a b
+ Control.Lens.Tuple: _5' :: Field5 s t a b => Lens s t a b
+ Control.Lens.Tuple: _6' :: Field6 s t a b => Lens s t a b
+ Control.Lens.Tuple: _7' :: Field7 s t a b => Lens s t a b
+ Control.Lens.Tuple: _8' :: Field8 s t a b => Lens s t a b
+ Control.Lens.Tuple: _9' :: Field9 s t a b => Lens s t a b
+ Control.Lens.Wrapped: instance (t ~ All) => Rewrapped All t
+ Control.Lens.Wrapped: instance (t ~ Any) => Rewrapped Any t
+ Control.Lens.Wrapped: instance (t ~ AssertionFailed) => Rewrapped AssertionFailed t
+ Control.Lens.Wrapped: instance (t ~ Backwards g b) => Rewrapped (Backwards f a) t
+ Control.Lens.Wrapped: instance (t ~ Comparison b) => Rewrapped (Comparison a) t
+ Control.Lens.Wrapped: instance (t ~ Compose f' g' a') => Rewrapped (Compose f g a) t
+ Control.Lens.Wrapped: instance (t ~ ComposeCF f' g' a') => Rewrapped (ComposeCF f g a) t
+ Control.Lens.Wrapped: instance (t ~ ComposeFC f' g' a') => Rewrapped (ComposeFC f g a) t
+ Control.Lens.Wrapped: instance (t ~ Const a' x') => Rewrapped (Const a x) t
+ Control.Lens.Wrapped: instance (t ~ Constant a' b') => Rewrapped (Constant a b) t
+ Control.Lens.Wrapped: instance (t ~ ContT r' m' a') => Rewrapped (ContT r m a) t
+ Control.Lens.Wrapped: instance (t ~ Coproduct f' g' a') => Rewrapped (Coproduct f g a) t
+ Control.Lens.Wrapped: instance (t ~ Dual b) => Rewrapped (Dual a) t
+ Control.Lens.Wrapped: instance (t ~ Endo b) => Rewrapped (Endo b) t
+ Control.Lens.Wrapped: instance (t ~ Equivalence b) => Rewrapped (Equivalence a) t
+ Control.Lens.Wrapped: instance (t ~ ErrorCall) => Rewrapped ErrorCall t
+ Control.Lens.Wrapped: instance (t ~ ErrorT e' m' a') => Rewrapped (ErrorT e m a) t
+ Control.Lens.Wrapped: instance (t ~ First b) => Rewrapped (First a) t
+ Control.Lens.Wrapped: instance (t ~ Identity b) => Rewrapped (Identity a) t
+ Control.Lens.Wrapped: instance (t ~ IdentityT n b) => Rewrapped (IdentityT m a) t
+ Control.Lens.Wrapped: instance (t ~ IntMap a') => Rewrapped (IntMap a) t
+ Control.Lens.Wrapped: instance (t ~ IntSet) => Rewrapped IntSet t
+ Control.Lens.Wrapped: instance (t ~ Kleisli m' a' b') => Rewrapped (Kleisli m a b) t
+ Control.Lens.Wrapped: instance (t ~ Last b) => Rewrapped (Last a) t
+ Control.Lens.Wrapped: instance (t ~ Last b) => Rewrapped (Last b) t
+ Control.Lens.Wrapped: instance (t ~ ListT n b) => Rewrapped (ListT m a) t
+ Control.Lens.Wrapped: instance (t ~ Max b) => Rewrapped (Max a) t
+ Control.Lens.Wrapped: instance (t ~ MaybeT n b) => Rewrapped (MaybeT m a) t
+ Control.Lens.Wrapped: instance (t ~ Min b) => Rewrapped (Min a) t
+ Control.Lens.Wrapped: instance (t ~ NoMethodError) => Rewrapped NoMethodError t
+ Control.Lens.Wrapped: instance (t ~ Op a' b') => Rewrapped (Op a b) t
+ Control.Lens.Wrapped: instance (t ~ Option b) => Rewrapped (Option a) t
+ Control.Lens.Wrapped: instance (t ~ PatternMatchFail) => Rewrapped PatternMatchFail t
+ Control.Lens.Wrapped: instance (t ~ Predicate b) => Rewrapped (Predicate a) t
+ Control.Lens.Wrapped: instance (t ~ Product b) => Rewrapped (Product a) t
+ Control.Lens.Wrapped: instance (t ~ RWST r' w' s' m' a') => Rewrapped (RWST r w s m a) t
+ Control.Lens.Wrapped: instance (t ~ ReaderT r n b) => Rewrapped (ReaderT r m a) t
+ Control.Lens.Wrapped: instance (t ~ RecConError) => Rewrapped RecConError t
+ Control.Lens.Wrapped: instance (t ~ RecSelError) => Rewrapped RecSelError t
+ Control.Lens.Wrapped: instance (t ~ RecUpdError) => Rewrapped RecUpdError t
+ Control.Lens.Wrapped: instance (t ~ Reverse g b) => Rewrapped (Reverse f a) t
+ Control.Lens.Wrapped: instance (t ~ Seq a') => Rewrapped (Seq a) t
+ Control.Lens.Wrapped: instance (t ~ StateT s' m' a') => Rewrapped (StateT s m a) t
+ Control.Lens.Wrapped: instance (t ~ Sum b) => Rewrapped (Sum a) t
+ Control.Lens.Wrapped: instance (t ~ TracedT m' w' a') => Rewrapped (TracedT m w a) t
+ Control.Lens.Wrapped: instance (t ~ Vector a') => Rewrapped (Vector a) t
+ Control.Lens.Wrapped: instance (t ~ WrappedArrow a' b' c') => Rewrapped (WrappedArrow a b c) t
+ Control.Lens.Wrapped: instance (t ~ WrappedMonad m' a') => Rewrapped (WrappedMonad m a) t
+ Control.Lens.Wrapped: instance (t ~ WrappedMonoid b) => Rewrapped (WrappedMonoid a) t
+ Control.Lens.Wrapped: instance (t ~ WriterT w' m' a') => Rewrapped (WriterT w m a) t
+ Control.Lens.Wrapped: instance (t ~ ZipList b) => Rewrapped (ZipList a) t
+ Control.Lens.Wrapped: instance forall (k :: BOX) (k1 :: BOX) (s :: k1) a t (s' :: k) a'. (t ~ Tagged s' a') => Rewrapped (Tagged s a) t
+ Control.Lens.Wrapped: instance forall (k :: BOX) (s :: k) a. Wrapped (Tagged s a)
+ Control.Monad.Error.Lens: [Handler] :: (e -> Maybe a) -> (a -> m r) -> Handler e m r
+ Data.Vector.Generic.Lens: converted :: (Vector v a, Vector w a, Vector v b, Vector w b) => Iso (v a) (v b) (w a) (w b)
- Control.Lens.Fold: cycled :: (Contravariant f, Apply f) => LensLike f s t a b -> LensLike f s t a b
+ Control.Lens.Fold: cycled :: Apply f => LensLike f s t a b -> LensLike f s t a b
- Control.Lens.Fold: iterated :: (a -> a) -> Fold1 a a
+ Control.Lens.Fold: iterated :: Apply f => (a -> a) -> LensLike' f a a
- Control.Lens.Fold: repeated :: Fold1 a a
+ Control.Lens.Fold: repeated :: Apply f => LensLike' f a a
- Control.Lens.Indexed: conjoined :: Conjoined p => (p ~ (->) => q (a -> b) r) -> q (p a b) r -> q (p a b) r
+ Control.Lens.Indexed: conjoined :: Conjoined p => ((p ~ (->)) => q (a -> b) r) -> q (p a b) r -> q (p a b) r
- Control.Lens.Internal.ByteString: traversedStrictTree :: Int -> IndexedTraversal' Int ByteString Word8
+ Control.Lens.Internal.ByteString: traversedStrictTree :: IndexedTraversal' Int ByteString Word8
- Control.Lens.Internal.ByteString: traversedStrictTree8 :: Int -> IndexedTraversal' Int ByteString Char
+ Control.Lens.Internal.ByteString: traversedStrictTree8 :: IndexedTraversal' Int ByteString Char
- Control.Lens.Internal.Indexed: conjoined :: Conjoined p => (p ~ (->) => q (a -> b) r) -> q (p a b) r -> q (p a b) r
+ Control.Lens.Internal.Indexed: conjoined :: Conjoined p => ((p ~ (->)) => q (a -> b) r) -> q (p a b) r -> q (p a b) r
- Control.Lens.Internal.Magma: runTakingWhile :: Corepresentable p => TakingWhile p f a b t -> Magma () t b (Corep p a)
+ Control.Lens.Internal.Magma: runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a)
- Control.Lens.Internal.TH: fromSet :: Ord k => (k -> v) -> Set k -> Map k v
+ Control.Lens.Internal.TH: fromSet :: (k -> v) -> Set k -> Map k v
- Control.Lens.Review: re :: AReview t b -> Getter b t
+ Control.Lens.Review: re :: Contravariant f => AReview t b -> LensLike' f b t
- Control.Monad.Primitive.Lens: prim :: PrimBase m => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #))
+ Control.Monad.Primitive.Lens: prim :: (PrimMonad m) => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #))
- Data.HashSet.Lens: setmapped :: (Eq i, Hashable i, Eq j, Hashable j) => IndexPreservingSetter (HashSet i) (HashSet j) i j
+ Data.HashSet.Lens: setmapped :: (Eq j, Hashable j) => IndexPreservingSetter (HashSet i) (HashSet j) i j
- Data.Set.Lens: setmapped :: (Ord i, Ord j) => IndexPreservingSetter (Set i) (Set j) i j
+ Data.Set.Lens: setmapped :: Ord j => IndexPreservingSetter (Set i) (Set j) i j
- Data.Vector.Generic.Lens: asStream :: Vector v a => Iso' (v a) (Stream a)
+ Data.Vector.Generic.Lens: asStream :: (Vector v a, Vector v b) => Iso (v a) (v b) (Stream a) (Stream b)
- Data.Vector.Generic.Lens: asStreamR :: Vector v a => Iso' (v a) (Stream a)
+ Data.Vector.Generic.Lens: asStreamR :: (Vector v a, Vector v b) => Iso (v a) (v b) (Stream a) (Stream b)
- Data.Vector.Generic.Lens: vector :: Vector v a => Iso' [a] (v a)
+ Data.Vector.Generic.Lens: vector :: (Vector v a, Vector v b) => Iso [a] [b] (v a) (v b)

Files

CHANGELOG.markdown view
@@ -1,6 +1,20 @@-4.7.0.1 [maintenance release]+4.8 ----* `primitive` 0.6 support+* When built with `profunctors` 4.4 on GHC 7.8+ we no longer need to use `unsafeCoerce` at all!+  This drastically reduces the level of trust involved in the way we have optimized `lens`.+* Added `fusing`. This optimizes long `Lens` chains, by enfocing a form of `fmap` fusion based on the Yoneda lemma. This is particularly effective at making faster lenses the definition is recursive or complex enough that it cannot be inlined.+* Added `confusing`. This optimizes long `Traversal` chains. As with `fusing` it is best used when the definition for the `Traversal` chain in question is recursive or complex enough that it cannot be inlined, but the implementation is much more confusing.+* Remove deprecated stuff: `Control.Lens.Loupe`, `headOf`, `makeFieldsWith`,+  `strippingPrefix`, `strippingSuffix`+* Added `Cons` and `Snoc` instances for `NonEmpty`+* Removed `Data.List.Split.Lens` module+* Reimplemented `bytestring` traversals to avoid internal modules+* Added `gplate`, an implementation of `plate` for any type implementing `Generic`+* Strictness revisited+  * Add `generateLazyPatterns` configuration flag to `makeLenses` rules.+  * Make the default `makeLenses` behavior to generate STRICT optics+  * Add strict variants of `_1` .. `_9` named `_1'` .. `_9'`+* Generalized some combinators in `Data.Vector.Generic.Lens` and added `converted`  4.7 ---
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2012-2014 Edward Kmett+Copyright 2012-2015 Edward Kmett  All rights reserved. 
README.markdown view
@@ -14,7 +14,8 @@ Field Guide ----------- -[![Lens Hierarchy](https://s3.amazonaws.com/creately-published/h5nyo9ne1)](https://creately.com/diagram/h5nyo9ne1/LBbRz63yg4yQsTXGLtub1bQU4%3D)+[![Lens Hierarchy](https://raw.githubusercontent.com/wiki/ekmett/lens/images/Hierarchy.png)](https://creately.com/diagram/h5nyo9ne1/QZ9UBOtw4AJWtmAKYK3wT8Mm1HM%3D)+  Examples --------
images/Hierarchy.png view

binary file changed (260302 → 855621 bytes)

lens-properties/src/Control/Lens/Properties.hs view
@@ -27,7 +27,7 @@ -- -- 3. @over l f . over l g ≡ over l (f . g)@ isSetter :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Function a)-         => Simple Setter s a -> Property+         => Setter' s a -> Property isSetter l = setter_id l .&. setter_composition l .&. setter_set_set l  @@ -39,7 +39,7 @@ -- -- 2. @fmap (t f) . t g ≡ getCompose . t (Compose . fmap f . g)@ isTraversal :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Function a)-         => Simple Traversal s a -> Property+         => Traversal' s a -> Property isTraversal l = isSetter l .&. traverse_pureMaybe l .&. traverse_pureList l                   .&. do as <- arbitrary                          bs <- arbitrary@@ -58,50 +58,50 @@ -- -- 3. @set l c (set l b a) ≡ set l c a@ isLens :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Eq a, Function a)-       => Simple Lens s a -> Property+       => Lens' s a -> Property isLens l = lens_set_view l .&. lens_view_set l .&. isTraversal l   -------------------------------------------------------------------------------- isIso :: (Arbitrary s, Arbitrary a, CoArbitrary s, CoArbitrary a, Show s, Show a, Eq s, Eq a, Function s, Function a)-      => Simple Iso s a -> Property+      => Iso' s a -> Property isIso l = iso_hither l .&. iso_yon l .&. isLens l .&. isLens (from l)   -------------------------------------------------------------------------------- isPrism :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Eq a, Function a)-      => Simple Prism s a -> Property+      => Prism' s a -> Property isPrism l = isTraversal l .&. prism_yin l .&. prism_yang l   -------------------------------------------------------------------------------- -- The first setter law:-setter_id :: Eq s => Simple Setter s a -> s -> Bool+setter_id :: Eq s => Setter' s a -> s -> Bool setter_id l s = over l id s == s  --  The second setter law:-setter_composition :: Eq s => Simple Setter s a -> s -> Fun a a -> Fun a a -> Bool+setter_composition :: Eq s => Setter' s a -> s -> Fun a a -> Fun a a -> Bool setter_composition l s (Fun _ f) (Fun _ g) = over l f (over l g s) == over l (f . g) s -lens_set_view :: Eq s => Simple Lens s a -> s -> Bool+lens_set_view :: Eq s => Lens' s a -> s -> Bool lens_set_view l s = set l (view l s) s == s -lens_view_set :: Eq a => Simple Lens s a -> s -> a -> Bool+lens_view_set :: Eq a => Lens' s a -> s -> a -> Bool lens_view_set l s a = view l (set l a s) == a -setter_set_set :: Eq s => Simple Setter s a -> s -> a -> a -> Bool+setter_set_set :: Eq s => Setter' s a -> s -> a -> a -> Bool setter_set_set l s a b = set l b (set l a s) == set l b s -iso_hither :: Eq s => Simple AnIso s a -> s -> Bool+iso_hither :: Eq s => AnIso' s a -> s -> Bool iso_hither l s = s ^.cloneIso l.from l == s -iso_yon :: Eq a => Simple AnIso s a -> a -> Bool+iso_yon :: Eq a => AnIso' s a -> a -> Bool iso_yon l a = a^.from l.cloneIso l == a -prism_yin :: Eq a => Simple Prism s a -> a -> Bool+prism_yin :: Eq a => Prism' s a -> a -> Bool prism_yin l a = preview l (review l a) == Just a -prism_yang :: Eq s => Simple Prism s a -> s -> Bool+prism_yang :: Eq s => Prism' s a -> s -> Bool prism_yang l s = maybe s (review l) (preview l s) == s  traverse_pure :: forall f s a. (Applicative f, Eq (f s)) => LensLike' f s a -> s -> Bool@@ -114,5 +114,5 @@ traverse_pureList = traverse_pure  traverse_compose :: (Applicative f, Applicative g, Eq (f (g s)))-                    => Simple Traversal s a -> (a -> g a) -> (a -> f a) -> s -> Bool+                    => Traversal' s a -> (a -> g a) -> (a -> f a) -> s -> Bool traverse_compose t f g s = (fmap (t f) . t g) s == (getCompose . t (Compose . fmap f . g)) s
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses, Generics-version:       4.7.0.1+version:       4.8 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE@@ -9,7 +9,7 @@ stability:     provisional homepage:      http://github.com/ekmett/lens/ bug-reports:   http://github.com/ekmett/lens/issues-copyright:     Copyright (C) 2012-2014 Edward A. Kmett+copyright:     Copyright (C) 2012-2015 Edward A. Kmett build-type:    Custom -- build-tools:   cpphs tested-with:   GHC == 7.4.1, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.1, GHC == 7.8.2@@ -41,7 +41,7 @@   With some signatures simplified, the core of the hierarchy of lens-like constructions looks like:   .   .-  <<http://i.imgur.com/4fHw3Fd.png>>+  <<http://i.imgur.com/ALlbPRa.png>>   .   <Hierarchy.png (Local Copy)>   .@@ -182,7 +182,7 @@ library   build-depends:     array                     >= 0.3.0.2  && < 0.6,-    base                      >= 4.3      && < 5,+    base                      >= 4.5      && < 5,     bifunctors                >= 4        && < 5,     bytestring                >= 0.9.1.10 && < 0.11,     comonad                   >= 4        && < 5,@@ -193,20 +193,20 @@     free                      >= 4        && < 5,     ghc-prim,     hashable                  >= 1.1.2.3  && < 1.3,+    kan-extensions            >= 4.2.1    && < 5,     exceptions                >= 0.1.1    && < 1,     mtl                       >= 2.0.1    && < 2.3,     parallel                  >= 3.1.0.1  && < 3.3,-    primitive                 >= 0.4.0.1  && < 0.7,+    primitive                 >= 0.4.0.1  && < 0.6,     profunctors               >= 4        && < 5,     reflection                >= 1.1.6    && < 2,     semigroupoids             >= 4        && < 5,     semigroups                >= 0.8.4    && < 1,-    split                     >= 0.2      && < 0.3,     tagged                    >= 0.4.4    && < 1,     template-haskell          >= 2.4      && < 2.11,     text                      >= 0.11     && < 1.3,     transformers              >= 0.2      && < 0.5,-    transformers-compat       >= 0.3      && < 1,+    transformers-compat       >= 0.4      && < 1,     unordered-containers      >= 0.2      && < 0.3,     vector                    >= 0.9      && < 0.11,     void                      >= 0.5      && < 1@@ -227,6 +227,7 @@     Control.Lens.Internal     Control.Lens.Internal.Bazaar     Control.Lens.Internal.ByteString+    Control.Lens.Internal.Coerce     Control.Lens.Internal.Context     Control.Lens.Internal.Deque     Control.Lens.Internal.Exception@@ -238,6 +239,7 @@     Control.Lens.Internal.Instances     Control.Lens.Internal.Iso     Control.Lens.Internal.Level+    Control.Lens.Internal.List     Control.Lens.Internal.Magma     Control.Lens.Internal.Prism     Control.Lens.Internal.Reflection@@ -248,7 +250,6 @@     Control.Lens.Iso     Control.Lens.Lens     Control.Lens.Level-    Control.Lens.Loupe     Control.Lens.Operators     Control.Lens.Plated     Control.Lens.Prism@@ -276,7 +277,6 @@     Data.HashSet.Lens     Data.IntSet.Lens     Data.List.Lens-    Data.List.Split.Lens     Data.Map.Lens     Data.Sequence.Lens     Data.Set.Lens@@ -401,7 +401,6 @@       parallel,       semigroups     >= 0.9,       simple-reflect >= 0.3.1,-      split,       text,       unordered-containers,       vector
src/Control/Exception/Lens.hs view
@@ -22,7 +22,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Exception.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -146,7 +146,7 @@ -- Catching ------------------------------------------------------------------------------ --- | Catch exceptions that match a given 'Prism' (or any 'Getter', really).+-- | Catch exceptions that match a given 'Prism' (or any 'Fold', really). -- -- >>> catching _AssertionFailed (assert False (return "uncaught")) $ \ _ -> return "caught" -- "caught"@@ -227,7 +227,7 @@ -- Trying ------------------------------------------------------------------------------ --- | A variant of 'Control.Exception.try' that takes a 'Prism' (or any 'Getter') to select which+-- | A variant of 'Control.Exception.try' that takes a 'Prism' (or any 'Fold') to select which -- exceptions are caught (c.f. 'Control.Exception.tryJust', 'Control.Exception.catchJust'). If the -- 'Exception' does not match the predicate, it is re-thrown. --
src/Control/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -55,7 +55,6 @@   , module Control.Lens.Iso   , module Control.Lens.Lens   , module Control.Lens.Level-  , module Control.Lens.Loupe   , module Control.Lens.Plated   , module Control.Lens.Prism   , module Control.Lens.Reified@@ -82,7 +81,6 @@ import Control.Lens.Iso import Control.Lens.Lens import Control.Lens.Level-import Control.Lens.Loupe import Control.Lens.Plated import Control.Lens.Prism import Control.Lens.Reified
src/Control/Lens/At.hs view
@@ -20,7 +20,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.At--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Combinators.hs view
@@ -1,7 +1,7 @@ -------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Combinators--- Copyright   :  (C) 2013-14 Edward Kmett+-- Copyright   :  (C) 2013-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Cons.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -9,7 +10,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Cons--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -40,6 +41,8 @@ import Control.Lens.Type import qualified Data.ByteString      as StrictB import qualified Data.ByteString.Lazy as LazyB+import           Data.List.NonEmpty   (NonEmpty(..))+import qualified Data.List.NonEmpty   as NonEmpty import           Data.Monoid import qualified Data.Sequence as Seq import           Data.Sequence hiding ((<|), (|>))@@ -94,6 +97,12 @@     []     -> Left  []   {-# INLINE _Cons #-} +instance a~b => Cons (NonEmpty a) (NonEmpty b) a b where+  _Cons = prism' (uncurry NonEmpty.cons) $ \ xyz -> case xyz of+    (x:|y:z) -> Just (x,y:|z)+    _        -> Nothing+  {-# INLINE _Cons #-}+ instance Cons (Seq a) (Seq b) a b where   _Cons = prism (uncurry (Seq.<|)) $ \aas -> case viewl aas of     a :< as -> Right (a, as)@@ -318,6 +327,12 @@     then Left []     else Right (Prelude.init aas, Prelude.last aas)   {-# INLINE _Snoc #-}++instance a~b => Snoc (NonEmpty a) (NonEmpty b) a b where+  _Snoc = prism' (\(x:|y,z) -> x:|y++[z]) $ \xyz -> case xyz of+    x:|y+      | Prelude.null y -> Nothing+      | otherwise      -> Just (x :| Prelude.init y, Prelude.last y)  instance Snoc (Seq a) (Seq b) a b where   _Snoc = prism (uncurry (Seq.|>)) $ \aas -> case viewr aas of
src/Control/Lens/Each.hs view
@@ -10,14 +10,10 @@ #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} #endif--#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Each--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -124,17 +120,10 @@   each f ~(a,b,c,d,e,g,h,i,j) = (,,,,,,,,) <$> f a <*> f b <*> f c <*> f d <*> f e <*> f g <*> f h <*> f i <*> f j   {-# INLINE each #-} -#if MIN_VERSION_base(4,4,0) -- | @'each' :: ('RealFloat' a, 'RealFloat' b) => 'Traversal' ('Complex' a) ('Complex' b) a b@ instance Each (Complex a) (Complex b) a b where   each f (a :+ b) = (:+) <$> f a <*> f b   {-# INLINE each #-}-#else--- | @'each' :: 'Traversal' ('Complex' a) ('Complex' b) a b@-instance (RealFloat a, RealFloat b) => Each (Complex a) (Complex b) a b where-  each f (a :+ b) = (:+) <$> f a <*> f b-  {-# INLINE each #-}-#endif  -- | @'each' :: 'Traversal' ('Map' c a) ('Map' c b) a b@ instance (c ~ d) => Each (Map c a) (Map d b) a b
src/Control/Lens/Empty.hs view
@@ -8,7 +8,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Empty--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Equality.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Equality--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Extras.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.List.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Fold.hs view
@@ -11,7 +11,7 @@ ---------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Fold--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -122,9 +122,6 @@   , itakingWhile   , idroppingWhile -  -- * Deprecated-  , headOf-   -- * Internal types   , Leftmost   , Rightmost@@ -236,7 +233,11 @@ -- -- >>> timingOut $ 5^..taking 20 repeated -- [5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]-repeated :: Fold1 a a+--+-- @+-- 'repeated' :: 'Fold1' a a+-- @+repeated :: Apply f => LensLike' f a a repeated f a = as where as = f a .> as {-# INLINE repeated #-} @@ -259,7 +260,11 @@ -- -- >>> timingOut $ [1,2,3]^..taking 7 (cycled traverse) -- [1,2,3,1,2,3,1]-cycled :: (Contravariant f, Apply f) => LensLike f s t a b -> LensLike f s t a b+--+-- @+-- 'cycled' :: 'Fold1' s a -> 'Fold1' s a+-- @+cycled :: Apply f => LensLike f s t a b -> LensLike f s t a b cycled l f a = as where as = l f a .> as {-# INLINE cycled #-} @@ -283,7 +288,11 @@ -- @ -- 'toListOf' ('iterated' f) a ≡ 'iterate' f a -- @-iterated :: (a -> a) -> Fold1 a a+--+-- @+-- 'iterated' :: (a -> a) -> 'Fold1' a a+-- @+iterated :: Apply f => (a -> a) -> LensLike' f a a iterated f g a0 = go a0 where   go a = g a .> go (f a) {-# INLINE iterated #-}@@ -1689,12 +1698,12 @@ -- exists, as a 'Maybe'. -- -- @--- 'pre' :: 'Getter' s a           -> 'IndexPreservingGetter' s ('Maybe' a)--- 'pre' :: 'Fold' s a             -> 'IndexPreservingGetter' s ('Maybe' a)--- 'pre' :: 'Simple' 'Traversal' s a -> 'IndexPreservingGetter' s ('Maybe' a)--- 'pre' :: 'Simple' 'Lens' s a      -> 'IndexPreservingGetter' s ('Maybe' a)--- 'pre' :: 'Simple' 'Iso' s a       -> 'IndexPreservingGetter' s ('Maybe' a)--- 'pre' :: 'Simple' 'Prism' s a     -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Getter' s a     -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Fold' s a       -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Traversal'' s a -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Lens'' s a      -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Iso'' s a       -> 'IndexPreservingGetter' s ('Maybe' a)+-- 'pre' :: 'Prism'' s a     -> 'IndexPreservingGetter' s ('Maybe' a) -- @ pre :: Getting (First a) s a -> IndexPreservingGetter s (Maybe a) pre l = dimap (getFirst . getConst #. l (Const #. First #. Just)) coerce@@ -1704,10 +1713,10 @@ -- and element, if they exist, as a 'Maybe'. -- -- @--- 'ipre' :: 'IndexedGetter' i s a             -> 'IndexPreservingGetter' s ('Maybe' (i, a))--- 'ipre' :: 'IndexedFold' i s a               -> 'IndexPreservingGetter' s ('Maybe' (i, a))--- 'ipre' :: 'Simple' ('IndexedTraversal' i) s a -> 'IndexPreservingGetter' s ('Maybe' (i, a))--- 'ipre' :: 'Simple' ('IndexedLens' i) s a      -> 'IndexPreservingGetter' s ('Maybe' (i, a))+-- 'ipre' :: 'IndexedGetter' i s a     -> 'IndexPreservingGetter' s ('Maybe' (i, a))+-- 'ipre' :: 'IndexedFold' i s a       -> 'IndexPreservingGetter' s ('Maybe' (i, a))+-- 'ipre' :: 'IndexedTraversal'' i s a -> 'IndexPreservingGetter' s ('Maybe' (i, a))+-- 'ipre' :: 'IndexedLens'' i s a      -> 'IndexPreservingGetter' s ('Maybe' (i, a)) -- @ ipre :: IndexedGetting i (First (i, a)) s a -> IndexPreservingGetter s (Maybe (i, a)) ipre l = dimap (getFirst . getConst #. l (Indexed $ \i a -> Const (First (Just (i, a))))) coerce@@ -2389,16 +2398,6 @@       b' = b && p i a     in (if b' then pure a else indexed f i a, b') {-# INLINE idroppingWhile #-}----------------------------------------------------------------------------------- Deprecated----------------------------------------------------------------------------------- | A deprecated alias for 'firstOf'.-headOf :: Getting (First a) s a -> s -> Maybe a-headOf l = getFirst #. foldMapOf l (First #. Just)-{-# INLINE headOf #-}-{-# DEPRECATED headOf "`headOf' will be removed after GHC 7.8 is released. (Use `preview' or `firstOf')" #-}  ------------------------------------------------------------------------------ -- Misc.
src/Control/Lens/Getter.hs view
@@ -12,7 +12,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Getter--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -51,6 +51,8 @@   -- * Building Getters   , to   , ito+  , like+  , ilike   -- * Combinators for Getters and Folds   , (^.)   , view, views@@ -131,6 +133,33 @@ ito k = dimap k (contramap (snd . k)) . uncurry . indexed {-# INLINE ito #-} ++-- | Build an constant-valued (index-preserving) 'Getter' from an arbitrary Haskell value.+--+-- @+-- 'like' a '.' 'like' b ≡ 'like' b+-- a '^.' 'like' b ≡ b+-- a '^.' 'like' b ≡ a '^.' 'to' ('const' b)+-- @+--+-- This can be useful as a second case 'failing' a 'Fold'+-- e.g. @foo `failing` 'like' 0@+--+-- @+-- 'like' :: a -> 'IndexPreservingGetter' s a+-- @+like :: (Profunctor p, Contravariant f) => a -> Optical' p p f s a+like a = to (const a)+{-# INLINE like #-}++-- |+-- @+-- 'ilike' :: i -> a -> 'IndexedGetter' i s a+-- @+ilike :: (Indexable i p, Contravariant f) => i -> a -> Optical' p (->) f s a+ilike i a = ito (const (i, a))+{-# INLINE ilike #-}+ -- | When you see this in a type signature it indicates that you can -- pass the function a 'Lens', 'Getter', -- 'Control.Lens.Traversal.Traversal', 'Control.Lens.Fold.Fold',@@ -455,7 +484,7 @@ s ^@. l = getConst $ l (Indexed $ \i -> Const #. (,) i) s {-# INLINE (^@.) #-} --- | Coerce a 'Getter'-compatible 'LensLike' to a 'Simple' 'LensLike'. This+-- | Coerce a 'Getter'-compatible 'LensLike' to a 'LensLike''. This -- is useful when using a 'Traversal' that is not simple as a 'Getter' or a -- 'Fold'. coerced :: (Functor f, Contravariant f) => LensLike f s t a b -> LensLike' f s a
src/Control/Lens/Indexed.hs view
@@ -18,7 +18,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Indexed--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -264,7 +264,7 @@    -- | The 'IndexedFold' of a 'FoldableWithIndex' container.   ---  -- 'ifolded'.'asIndex' is a fold over the keys of a 'FoldableWithIndex'.+  -- @'ifolded' '.' 'asIndex'@ is a fold over the keys of a 'FoldableWithIndex'.   --   -- >>> Data.Map.fromList [(2, "hello"), (1, "world")]^..ifolded.asIndex   -- [1,2]
src/Control/Lens/Internal.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Bazaar.hs view
@@ -13,7 +13,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Bazaar--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/ByteString.hs view
@@ -6,16 +6,19 @@ #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} #endif+ #ifndef MIN_VERSION_base #define MIN_VERSION_base(x,y,z) 1 #endif -{-# OPTIONS_GHC -fno-warn-deprecations #-} -- for inlinePerformIO+#ifndef MIN_VERSION_bytestring+#define MIN_VERSION_bytestring(x,y,z) 1+#endif  ----------------------------------------------------------------------------- -- | -- Module      :  Data.ByteString.Strict.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -26,8 +29,8 @@ -- Haskell Platforms and to improve constant and asymptotic factors in our performance. ---------------------------------------------------------------------------- module Control.Lens.Internal.ByteString-  ( unpackStrict, traversedStrict, traversedStrictTree-  , unpackStrict8, traversedStrict8, traversedStrictTree8+  ( unpackStrict, traversedStrictTree+  , unpackStrict8, traversedStrictTree8   , unpackLazy, traversedLazy   , unpackLazy8, traversedLazy8   ) where@@ -35,10 +38,13 @@ import Control.Applicative import Control.Lens import qualified Data.ByteString               as B+#if MIN_VERSION_bytestring(0,10,4)+import qualified Data.ByteString.Char8         as B8+#endif import qualified Data.ByteString.Lazy          as BL-import qualified Data.ByteString.Lazy.Internal as BLI import qualified Data.ByteString.Lazy.Char8    as BL8 import qualified Data.ByteString.Internal      as BI+import qualified Data.ByteString.Unsafe        as BU import Data.Bits import Data.Char import Data.Int (Int64)@@ -47,10 +53,11 @@ import Foreign.Storable #if MIN_VERSION_base(4,8,0) import Foreign.ForeignPtr-import Foreign.ForeignPtr.Unsafe #elif MIN_VERSION_base(4,4,0) import Foreign.ForeignPtr.Safe-import Foreign.ForeignPtr.Unsafe+#if !MIN_VERSION_bytestring(0,10,4)+import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)+#endif #else import Foreign.ForeignPtr #endif@@ -58,84 +65,42 @@ import GHC.ForeignPtr (mallocPlainForeignPtrBytes) import GHC.IO (unsafeDupablePerformIO) --- | Traverse a strict 'B.ByteString' from left to right in a biased fashion.-traversedStrict :: Int -> IndexedTraversal' Int B.ByteString Word8-traversedStrict i0 pafb (BI.PS fp off len) =-  let p = unsafeForeignPtrToPtr fp-   in fmap (rebuild len) (go i0 (p `plusPtr` off) (p `plusPtr` (off+len)))- where-   rebuild n = \xs -> unsafeCreate n $ \p -> go2 p xs-   go2 !p (x:xs) = poke p x >> go2 (p `plusPtr` 1) xs-   go2 _  []     = return ()-   -- TODO: use a balanced tree (up to some grain size)-   go !i !p !q-     | p == q = pure []-     | otherwise = let !x = BI.inlinePerformIO $ do-                              x' <- peek p-                              touchForeignPtr fp-                              return x'-                   in (:) <$> indexed pafb (i :: Int) x <*> go (i + 1) (p `plusPtr` 1) q-{-# INLINE traversedStrict #-}---- | Traverse a strict 'B.ByteString' from left to right in a biased fashion--- pretending the bytes are characters.-traversedStrict8 :: Int -> IndexedTraversal' Int B.ByteString Char-traversedStrict8 i0 pafb (BI.PS fp off len) =-  let p = unsafeForeignPtrToPtr fp-   in fmap (rebuild len) (go i0 (p `plusPtr` off) (p `plusPtr` (off+len)))- where-   rebuild n = \xs -> unsafeCreate n $ \p -> go2 p xs-   go2 !p (x:xs) = poke p (c2w x) >> go2 (p `plusPtr` 1) xs-   go2 _  []     = return ()-   -- TODO: use a balanced tree (up to some grain size)-   go !i !p !q-     | p == q = pure []-     | otherwise = let !x = BI.inlinePerformIO $ do-                              x' <- peek p-                              touchForeignPtr fp-                              return x'-                   in (:) <$> indexed pafb (i :: Int) (w2c x) <*> go (i + 1) (p `plusPtr` 1) q-{-# INLINE traversedStrict8 #-}- grain :: Int grain = 32 {-# INLINE grain #-}  -- | Traverse a strict 'B.ByteString' in a relatively balanced fashion, as a balanced tree with biased runs of -- elements at the leaves.-traversedStrictTree :: Int -> IndexedTraversal' Int B.ByteString Word8-traversedStrictTree i0 pafb (BI.PS fp off len) = rebuild len <$> go (unsafeForeignPtrToPtr fp `plusPtr` (off - i0)) i0 (i0 + len)+traversedStrictTree :: IndexedTraversal' Int B.ByteString Word8+traversedStrictTree pafb bs = unsafeCreate len <$> go 0 len  where-   rebuild n f = unsafeCreate n $ \q -> f $! (q `plusPtr` (off - i0))-   go !p !i !j-     | i + grain < j, k <- i + shiftR (j - i) 1 = (\l r q -> l q >> r q) <$> go p i k <*> go p k j-     | otherwise = run p i j-   run !p !i !j+   len = B.length bs+   go !i !j+     | i + grain < j, k <- i + shiftR (j - i) 1 = (\l r q -> l q >> r q) <$> go i k <*> go k j+     | otherwise = run i j+   run !i !j      | i == j    = pure (\_ -> return ())-     | otherwise = let !x = BI.inlinePerformIO $ do-                          x' <- peekByteOff p i-                          touchForeignPtr fp-                          return x'-                   in (\y ys !q -> pokeByteOff q i y >> ys q) <$> indexed pafb (i :: Int) x <*> run p (i + 1) j+     | otherwise = let !x = BU.unsafeIndex bs i+                   in (\y ys q -> pokeByteOff q i y >> ys q) <$> indexed pafb (i :: Int) x <*> run (i + 1) j {-# INLINE traversedStrictTree #-} + -- | Traverse a strict 'B.ByteString' in a relatively balanced fashion, as a balanced tree with biased runs of -- elements at the leaves, pretending the bytes are chars.-traversedStrictTree8 :: Int -> IndexedTraversal' Int B.ByteString Char-traversedStrictTree8 i0 pafb (BI.PS fp off len) = rebuild len <$> go i0 (i0 + len)+traversedStrictTree8 :: IndexedTraversal' Int B.ByteString Char+traversedStrictTree8 pafb bs = unsafeCreate len <$> go 0 len  where-   p = unsafeForeignPtrToPtr fp `plusPtr` (off - i0)-   rebuild n f = unsafeCreate n $ \q -> f (q `plusPtr` (off - i0))+   len = B.length bs    go !i !j-     | i + grain < j, k <- i + shiftR (j - i) 1 = (\l r q -> l q >> r q) <$> go i k <*> go k j-     | otherwise = run i j+     | i + grain < j    = let k = i + shiftR (j - i) 1+                          in (\l r q -> l q >> r q) <$> go i k <*> go k j+     | otherwise        = run i j    run !i !j-     | i == j    = pure (\_ -> return ())-     | otherwise = let !x = BI.inlinePerformIO $ do-                          x' <- peekByteOff p i-                          touchForeignPtr fp-                          return x'-                   in (\y ys q -> poke (q `plusPtr` i) (c2w y) >> ys q) <$> indexed pafb (i :: Int) (w2c x) <*> run (i + 1) j+     | i == j           = pure (\_ -> return ())+     | otherwise        = let !x = BU.unsafeIndex bs i+                          in (\y ys q -> pokeByteOff q i (c2w y) >> ys q)+                         <$> indexed pafb (i :: Int) (w2c x)+                         <*> run (i + 1) j {-# INLINE traversedStrictTree8 #-}  -- | Unpack a lazy 'Bytestring'@@ -145,10 +110,14 @@  -- | An 'IndexedTraversal' of the individual bytes in a lazy 'BL.ByteString' traversedLazy :: IndexedTraversal' Int64 BL.ByteString Word8-traversedLazy pafb = go 0 where-  go _ BLI.Empty        = pure BLI.Empty-  go i (BLI.Chunk b bs) = BLI.Chunk <$> reindexed (fromIntegral :: Int -> Int64) (traversedStrictTree (fromIntegral i)) pafb b <*> go i' bs-    where !i' = i + B.length b+traversedLazy pafb = \lbs -> foldrChunks go (\_ -> pure BL.empty) lbs 0+  where+  go c fcs acc = BL.append . fromStrict+             <$> reindexed (\x -> acc + fromIntegral x :: Int64) traversedStrictTree pafb c+             <*> fcs acc'+    where+    acc' :: Int64+    !acc' = acc + fromIntegral (B.length c) {-# INLINE traversedLazy #-}  @@ -159,16 +128,36 @@  -- | An 'IndexedTraversal' of the individual bytes in a lazy 'BL.ByteString' pretending the bytes are chars. traversedLazy8 :: IndexedTraversal' Int64 BL.ByteString Char-traversedLazy8 pafb = go 0 where-  go _ BLI.Empty = pure BLI.Empty-  go i (BLI.Chunk b bs) = BLI.Chunk <$> reindexed (fromIntegral :: Int -> Int64) (traversedStrictTree8 (fromIntegral i)) pafb b <*> go i' bs-    where !i' = i + B.length b+traversedLazy8 pafb = \lbs -> foldrChunks go (\_ -> pure BL.empty) lbs 0+  where+  go c fcs acc = BL.append . fromStrict+             <$> reindexed (\x -> acc + fromIntegral x :: Int64) traversedStrictTree8 pafb c+             <*> fcs acc'+    where+    acc' :: Int64+    !acc' = acc + fromIntegral (B.length c) {-# INLINE traversedLazy8 #-}  ------------------------------------------------------------------------------ -- ByteString guts ------------------------------------------------------------------------------ +fromStrict :: B.ByteString -> BL.ByteString+#if MIN_VERSION_bytestring(0,10,0)+fromStrict = BL.fromStrict+#else+fromStrict = \x -> BL.fromChunks [x]+#endif+{-# INLINE fromStrict #-}++foldrChunks :: (B.ByteString -> r -> r) -> r -> BL.ByteString -> r+#if MIN_VERSION_bytestring(0,10,0)+foldrChunks = BL.foldrChunks+#else+foldrChunks f z b = foldr f z (BL.toChunks b)+#endif+{-# INLINE foldrChunks #-}+ -- | Conversion between 'Word8' and 'Char'. Should compile to a no-op. w2c :: Word8 -> Char w2c = unsafeChr . fromIntegral@@ -181,10 +170,11 @@ c2w = fromIntegral . ord {-# INLINE c2w #-} --- TODO: Should this create the list in chunks, like unpackBytes does in 0.10?- -- | Unpack a strict 'B.Bytestring' unpackStrict :: B.ByteString -> [Word8]+#if MIN_VERSION_bytestring(0,10,4)+unpackStrict = B.unpack+#else unpackStrict (BI.PS fp off len) =       let p = unsafeForeignPtrToPtr fp        in go (p `plusPtr` off) (p `plusPtr` (off+len))@@ -195,12 +185,14 @@                                         touchForeignPtr fp                                         return x'                              in x : go (p `plusPtr` 1) q+#endif {-# INLINE unpackStrict #-} --- TODO: Should this create the list in chunks, like unpackBytes does in 0.10?- -- | Unpack a strict 'B.Bytestring', pretending the bytes are chars. unpackStrict8 :: B.ByteString -> String+#if MIN_VERSION_bytestring(0,10,4)+unpackStrict8 = B8.unpack+#else unpackStrict8 (BI.PS fp off len) =       let p = unsafeForeignPtrToPtr fp        in go (p `plusPtr` off) (p `plusPtr` (off+len))@@ -211,6 +203,7 @@                                         touchForeignPtr fp                                         return x'                              in w2c x : go (p `plusPtr` 1) q+#endif {-# INLINE unpackStrict8 #-}  
+ src/Control/Lens/Internal/Coerce.hs view
@@ -0,0 +1,48 @@+{-# LANGUAGE CPP #-}++#ifndef MIN_VERSION_profunctors+#define MIN_VERSION_profunctors(x,y,z) 0+#endif++#if (MIN_VERSION_profunctors(4,4,0)) && __GLASGOW_HASKELL__ >= 708+#define USE_COERCE+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE ScopedTypeVariables #-}+#else+{-# LANGUAGE Unsafe #-}+#endif+-----------------------------------------------------------------------------+-- |+-- Copyright   :  (C) 2015 Edward Kmett and Eric Mertens+-- License     :  BSD-style (see the file LICENSE)+-- Maintainer  :  Edward Kmett <ekmett@gmail.com>+-- Stability   :  experimental+-- Portability :  non-portable+--+-- This module provides a shim around 'coerce' that defaults to 'unsafeCoerce'+-- on GHC < 7.8+-----------------------------------------------------------------------------+module Control.Lens.Internal.Coerce+  ( coerce+  , coerce'+  ) where++#ifdef USE_COERCE++import Data.Coerce++coerce' :: forall a b. Coercible a b => b -> a+coerce' = coerce (id :: a -> a)+{-# INLINE coerce' #-}++#else++import Unsafe.Coerce++coerce, coerce' :: a -> b+coerce  = unsafeCoerce+coerce' = unsafeCoerce+{-# INLINE coerce #-}+{-# INLINE coerce' #-}+#endif
src/Control/Lens/Internal/Context.hs view
@@ -15,7 +15,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Context--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Deque.hs view
@@ -13,7 +13,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Deque--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Exception.hs view
@@ -19,7 +19,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Exception--- Copyright   :  (C) 2013-2014 Edward Kmett+-- Copyright   :  (C) 2013-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -181,11 +181,7 @@   {-# INLINE typeOf #-}  handlingTyCon :: TyCon-#if MIN_VERSION_base(4,4,0) handlingTyCon = mkTyCon3 "lens" "Control.Lens.Internal.Exception" "Handling"-#else-handlingTyCon = mkTyCon "Control.Lns.Internal.Exception.Handling"-#endif {-# NOINLINE handlingTyCon #-} #endif @@ -194,7 +190,7 @@   showsPrec d _ = showParen (d > 10) $ showString "Handling ..."   {-# INLINE showsPrec #-} -instance (Reifies s (SomeException -> Maybe a), Typeable a, Typeable1 m, Typeable s) => Exception (Handling a s m) where+instance (Reifies s (SomeException -> Maybe a), Typeable (Handling a s m)) => Exception (Handling a s m) where   toException _ = SomeException HandlingException   {-# INLINE toException #-}   fromException = fmap Handling . reflect (Proxy :: Proxy s)
src/Control/Lens/Internal/FieldTH.hs view
@@ -7,7 +7,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.FieldTH--- Copyright   :  (C) 2014 Edward Kmett, (C) 2014 Eric Mertens+-- Copyright   :  (C) 2014-2015 Edward Kmett, (C) 2014 Eric Mertens -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -274,7 +274,7 @@           TopName n      -> fun n           MethodName c n -> [makeFieldInstance defType c (fun n)] -  clauses = makeFieldClauses opticType cons+  clauses = makeFieldClauses rules opticType cons   ------------------------------------------------------------------------@@ -375,8 +375,8 @@ ------------------------------------------------------------------------  -makeFieldClauses :: OpticType -> [(Name, Int, [Int])] -> [ClauseQ]-makeFieldClauses opticType cons =+makeFieldClauses :: LensRules -> OpticType -> [(Name, Int, [Int])] -> [ClauseQ]+makeFieldClauses rules opticType cons =   case opticType of      IsoType    -> [ makeIsoClause conName | (conName, _, _) <- cons ]@@ -384,11 +384,14 @@     GetterType -> [ makeGetterClause conName fieldCount fields                     | (conName, fieldCount, fields) <- cons ] -    LensType   -> let irref = length cons == 1 in-                  [ makeFieldOpticClause conName fieldCount fields irref+    LensType   -> [ makeFieldOpticClause conName fieldCount fields irref                     | (conName, fieldCount, fields) <- cons ]+      where+      irref = _lazyPatterns rules+           && length cons == 1  + -- | Construct an optic clause that returns an unmodified value -- given a constructor name and the number of fields on that -- constructor.@@ -545,6 +548,7 @@   , _generateClasses :: Bool   , _allowIsos       :: Bool   , _allowUpdates    :: Bool -- ^ Allow Lens/Traversal (otherwise Getter/Fold)+  , _lazyPatterns    :: Bool   , _fieldToDef      :: Name -> [Name] -> Name -> [DefName]        -- ^ Type Name -> Field Names -> Target Field Name -> Definition Names   , _classyLenses    :: Name -> Maybe (Name,Name)
src/Control/Lens/Internal/Fold.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Fold--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Getter.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Getter--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Internal/Indexed.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-}@@ -10,7 +11,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Indexed--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -50,7 +51,7 @@ import Prelude hiding ((.),id) #ifndef SAFE import Data.Profunctor.Unsafe-import Unsafe.Coerce+import Control.Lens.Internal.Coerce #endif  ------------------------------------------------------------------------------@@ -147,9 +148,9 @@   rmap bc iab = Indexed $ \i -> bc . runIndexed iab i   {-# INLINE rmap #-} #ifndef SAFE-  ( .# ) ibc _ = unsafeCoerce ibc+  ( .# ) ibc _ = coerce ibc   {-# INLINE ( .# ) #-}-  ( #. ) _ = unsafeCoerce+  ( #. ) _ = coerce'   {-# INLINE ( #. ) #-} #endif 
src/Control/Lens/Internal/Instances.hs view
@@ -11,7 +11,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Instances--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Iso.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Iso--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -20,7 +20,7 @@ import Data.Profunctor #ifndef SAFE import Data.Profunctor.Unsafe-import Unsafe.Coerce+import Control.Lens.Internal.Coerce #endif import Data.ByteString       as StrictB import Data.ByteString.Lazy  as LazyB@@ -52,9 +52,9 @@   rmap f (Exchange sa bt) = Exchange sa (f . bt)   {-# INLINE rmap #-} #ifndef SAFE-  ( #. ) _ = unsafeCoerce+  ( #. ) _ = coerce'   {-# INLINE ( #. ) #-}-  ( .# ) p _ = unsafeCoerce p+  ( .# ) p _ = coerce p   {-# INLINE ( .# ) #-} #endif 
src/Control/Lens/Internal/Level.hs view
@@ -8,7 +8,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Level--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
+ src/Control/Lens/Internal/List.hs view
@@ -0,0 +1,41 @@+-------------------------------------------------------------------------------+-- |+-- Module      :  Control.Lens.Internal.List+-- Copyright   :  (C) 2014-2015 Edward Kmett and Eric Mertens+-- License     :  BSD-style (see the file LICENSE)+-- Maintainer  :  Edward Kmett <ekmett@gmail.com>+-- Stability   :  provisional+-- Portability :  non-portable+--+-- This module provides utility functions on lists used by the library+-- implementation.+-------------------------------------------------------------------------------+module Control.Lens.Internal.List+  ( ordinalNub+  ) where++import Data.IntSet (IntSet)+import qualified Data.IntSet as IntSet++{-# ANN module "HLint: ignore Redundant bracket" #-}++-- | Return the the subset of given ordinals within a given bound+-- and in order of the first occurrence seen.+--+-- Bound: @0 <= x < l@+--+-- >>> ordinalNub 3 [-1,2,1,4,2,3]+-- [2,1]+ordinalNub ::+  Int   {- ^ strict upper bound -} ->+  [Int] {- ^ ordinals           -} ->+  [Int] {- ^ unique, in-bound ordinals, in order seen -}+ordinalNub l xs = foldr (ordinalNubHelper l) (const []) xs IntSet.empty++ordinalNubHelper :: Int -> Int -> (IntSet -> [Int]) -> (IntSet -> [Int])+ordinalNubHelper l x next seen+  | outOfBounds || notUnique = next seen+  | otherwise                = x : next (IntSet.insert x seen)+  where+  outOfBounds = x < 0 || l <= x+  notUnique   = x `IntSet.member` seen
src/Control/Lens/Internal/Magma.hs view
@@ -16,7 +16,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Magma--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -225,7 +225,7 @@ #endif  -- | Generate a 'Magma' with leaves only while the predicate holds from left to right.-runTakingWhile :: Corepresentable p => TakingWhile p f a b t -> Magma () t b (Corep p a)+runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a) runTakingWhile (TakingWhile _ _ k) = k True  instance Functor (TakingWhile p f a b) where@@ -253,6 +253,7 @@     go (Magma _ wa) = corep pafb wa   {-# INLINE bazaar #-} +-- This constraint is unused intentionally, it protects TakingWhile instance Contravariant f => Contravariant (TakingWhile p f a b) where   contramap _ = (<$) (error "contramap: TakingWhile")   {-# INLINE contramap #-}
src/Control/Lens/Internal/Prism.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Prism--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -20,7 +20,7 @@ import Data.Profunctor #ifndef SAFE import Data.Profunctor.Unsafe-import Unsafe.Coerce+import Control.Lens.Internal.Coerce #endif  ------------------------------------------------------------------------------@@ -47,9 +47,9 @@   {-# INLINE rmap #-}  #ifndef SAFE-  ( #. ) _ = unsafeCoerce+  ( #. ) _ = coerce'   {-# INLINE ( #. ) #-}-  ( .# ) p _ = unsafeCoerce p+  ( .# ) p _ = coerce p   {-# INLINE ( .# ) #-} #endif 
src/Control/Lens/Internal/PrismTH.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.PrismTH--- Copyright   :  (C) 2014 Edward Kmett, (C) 2014 Eric Mertens+-- Copyright   :  (C) 2014-2015 Edward Kmett and Eric Mertens -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Internal/Reflection.hs view
@@ -13,7 +13,7 @@ ---------------------------------------------------------------------------- -- | -- Module     : Control.Lens.Internal.Reflection--- Copyright  : 2009-2014 Edward Kmett,+-- Copyright  : 2009-2015 Edward Kmett, --              2012 Elliott Hird, --              2004 Oleg Kiselyov and Chung-chieh Shan -- License    : BSD3@@ -180,7 +180,7 @@  -- This had to be moved to the top level, due to an apparent bug in -- the ghc inliner introduced in ghc 7.0.x-reflectBefore :: Reifies s a => (Proxy s -> b) -> proxy s -> b+reflectBefore :: (Proxy s -> b) -> proxy s -> b reflectBefore f = const $! f Proxy {-# NOINLINE reflectBefore #-} 
src/Control/Lens/Internal/Review.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Review--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Internal/Setter.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Setter--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Internal/TH.hs view
@@ -21,7 +21,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.TH--- Copyright   :  (C) 2013-2014 Edward Kmett, 2013 Eric Mertens+-- Copyright   :  (C) 2013-2015 Edward Kmett and Eric Mertens -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -80,11 +80,11 @@ bndrName (PlainTV  n  ) = n bndrName (KindedTV n _) = n -fromSet :: Ord k => (k -> v) -> Set.Set k -> Map.Map k v+fromSet :: (k -> v) -> Set.Set k -> Map.Map k v #if MIN_VERSION_containers(0,5,0) fromSet = Map.fromSet #else-fromSet f x = Map.fromList [ (k,f k) | k <- Set.toList x ]+fromSet f x = Map.fromDistinctAscList [ (k,f k) | k <- Set.toAscList x ] #endif  ------------------------------------------------------------------------
src/Control/Lens/Internal/Zoom.hs view
@@ -9,7 +9,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Internal.Zoom--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Iso.hs view
@@ -12,7 +12,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Iso--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Lens.hs view
@@ -15,7 +15,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -120,6 +120,9 @@   , Context(..)   , Context'   , locus++  -- * Lens fusion+  , fusing   ) where  import Control.Applicative@@ -130,12 +133,16 @@ import Control.Lens.Internal.Indexed import Control.Lens.Type import Control.Monad.State as State+import Data.Functor.Yoneda import Data.Monoid import Data.Profunctor import Data.Profunctor.Rep import Data.Profunctor.Unsafe import Data.Void import Prelude+#if __GLASGOW_HASKELL__ >= 710+import Data.Function ((&))+#endif  #ifdef HLINT {-# ANN module "HLint: ignore Use ***" #-}@@ -159,7 +166,7 @@ infix  4 %%@=, <%@=, <<%@=, %%=, <+=, <*=, <-=, <//=, <^=, <^^=, <**=, <&&=, <||=, <<>=, <%=, <<%=, <<.=, <#=, #=, #%=, <#%=, #%%=        , <<+=, <<-=, <<*=, <<//=, <<^=, <<^^=, <<**=, <<||=, <<&&=, <<<>= infixr 2 <<~-infixl 1 &, <&>, ??, &~+infixl 1 <&>, ??, &~  ------------------------------------------------------------------------------- -- Lenses@@ -312,6 +319,8 @@ -- General Purpose Combinators ------------------------------------------------------------------------------- ++#if __GLASGOW_HASKELL__ < 710 -- | Passes the result of the left side to the function on the right side (forward pipe operator). -- -- This is the flipped version of ('$'), which is more common in languages like F# as (@|>@) where it is needed@@ -336,6 +345,8 @@ (&) :: a -> (a -> b) -> b a & f = f a {-# INLINE (&) #-}+infixl 1 &+#endif  -- | Infix flipped 'fmap'. --@@ -1195,7 +1206,9 @@ -- adjust all of the targets of an 'Control.Lens.Traversal.IndexedTraversal' and return a monoidal summary -- along with the answer. ----- @l '<%~' f ≡ l '<%@~' 'const' f@+-- @+-- l '<%~' f ≡ l '<%@~' 'const' f+-- @ -- -- When you do not need access to the index then ('<%~') is more liberal in what it can accept. --@@ -1226,7 +1239,9 @@ -- adjust all of the targets of an 'Control.Lens.Traversal.IndexedTraversal' and return a monoidal summary -- of the supplementary results and the answer. ----- @('%%@~') ≡ 'Control.Lens.Indexed.withIndex'@+-- @+-- ('%%@~') ≡ 'Control.Lens.Indexed.withIndex'+-- @ -- -- @ -- ('%%@~') :: 'Functor' f => 'IndexedLens' i s t a b      -> (i -> a -> f b) -> s -> f t@@ -1248,7 +1263,9 @@ -- adjust all of the targets of an 'Control.Lens.Traversal.IndexedTraversal' within the current state, and -- return a monoidal summary of the supplementary results. ----- @l '%%@=' f ≡ 'state' (l '%%@~' f)@+-- @+-- l '%%@=' f ≡ 'state' (l '%%@~' f)+-- @ -- -- @ -- ('%%@=') :: 'MonadState' s m                 => 'IndexedLens' i s s a b      -> (i -> a -> (r, b)) -> s -> m r@@ -1416,3 +1433,26 @@ united :: Lens' a () united f v = f () <&> \ () -> v {-# INLINE united #-}++-- | Fuse a composition of lenses using 'Yoneda' to provide 'fmap' fusion.+--+-- In general, given a pair of lenses 'foo' and 'bar'+--+-- @+-- fusing (foo.bar) = foo.bar+-- @+--+-- however, @foo@ and @bar@ are either going to 'fmap' internally or they are trivial.+--+-- 'fusing' exploits the 'Yoneda' lemma to merge these separate uses into a single 'fmap'.+--+-- This is particularly effective when the choice of functor 'f' is unknown at compile+-- time or when the 'Lens' @foo.bar@ in the above description is recursive or complex+-- enough to prevent inlining.+--+-- @+-- 'fusing' :: 'Lens' s t a b -> 'Lens' s t a b+-- @+fusing :: Functor f => LensLike (Yoneda f) s t a b -> LensLike f s t a b+fusing t = \f -> lowerYoneda . t (liftYoneda . f)+{-# INLINE fusing #-}
src/Control/Lens/Level.hs view
@@ -7,7 +7,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Level--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -36,7 +36,7 @@ -- >>> import Data.Char  levelIns :: Bazaar (->) a b t -> [Level () a]-levelIns = go 0 . (getConst #. bazaar (Const #. deepening ())) where+levelIns = go 0 . (getConst #. bazaar (rmapConst (deepening ()))) where   go k z = k `seq` runDeepening z k $ \ xs b ->     xs : if b then (go $! k + 1) z else [] {-# INLINE levelIns #-}@@ -83,8 +83,14 @@   bz = l sell s {-# INLINE levels #-} +-- This is only a temporary work around added to deal with a bug in an unreleased version+-- of GHC 7.10. We should remove it as soon as we're able.+rmapConst :: Profunctor p => p a b -> p a (Const b x)+rmapConst p = Const #. p+{-# INLINE rmapConst #-}+ ilevelIns :: Bazaar (Indexed i) a b t -> [Level i a]-ilevelIns = go 0 . (getConst #. bazaar (Indexed $ \ i -> Const #. deepening i)) where+ilevelIns = go 0 . (getConst #. bazaar (Indexed $ \ i -> rmapConst (deepening i))) where   go k z = k `seq` runDeepening z k $ \ xs b ->     xs : if b then (go $! k + 1) z else [] {-# INLINE ilevelIns #-}
− src/Control/Lens/Loupe.hs
@@ -1,43 +0,0 @@----------------------------------------------------------------------------------- |--- Module      :  Control.Lens.Loupe--- Copyright   :  (C) 2012-14 Edward Kmett--- License     :  BSD-style (see the file LICENSE)--- Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  provisional--- Portability :  Rank2Types------ This module exports a minimalist API for working with lenses in highly--- monomorphic settings.---------------------------------------------------------------------------------module Control.Lens.Loupe-  (-    ALens, ALens'-  , cloneLens-  , storing-  , (^#)-  , ( #~ ), ( #%~ ), ( #%%~ ), (<#~), (<#%~)-  , ( #= ), ( #%= ), ( #%%= ), (<#=), (<#%=)-  -- * Deprecated Aliases-  , Loupe, SimpleLoupe-  ) where--import Control.Lens.Internal.Context-import Control.Lens.Lens-import Control.Lens.Type---- | This is an older alias for a type-restricted form of lens that is able to be passed around--- in containers monomorphically.------ Deprecated. This has since been renamed to 'ALens' for consistency.-type Loupe s t a b = LensLike (Pretext (->) a b) s t a b-{-# DEPRECATED Loupe "use ALens" #-}---- | @--- type 'SimpleLoupe' = 'Simple' 'Loupe'--- @------ Deprecated for two reasons. 'Loupe' is now 'ALens', and we no longer use the verbose @SimpleFoo@ naming--- convention, this has since been renamed to 'ALens'' for consistency.-type SimpleLoupe s a = Loupe s s a a-{-# DEPRECATED SimpleLoupe "use ALens'" #-}
src/Control/Lens/Operators.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Operators--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Control/Lens/Plated.hs view
@@ -3,8 +3,16 @@ {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} +#if __GLASGOW_HASKELL__ < 710+{-# LANGUAGE OverlappingInstances #-}+#define OVERLAPPING_PRAGMA+#else+#define OVERLAPPING_PRAGMA {-# OVERLAPPING #-}+#endif+ #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} -- template-haskell #endif@@ -19,7 +27,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Plated--- Copyright   :  (C) 2012-13 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -80,6 +88,10 @@    -- * Parts   , parts++  -- * Generics+  , gplate+  , GPlated   )   where @@ -104,6 +116,7 @@ import Data.Data.Lens import Data.Monoid import Data.Tree+import GHC.Generics  #ifdef HLINT {-# ANN module "HLint: ignore Reduce duplication" #-}@@ -673,3 +686,44 @@ parts :: Plated a => Lens' a [a] parts = partsOf plate {-# INLINE parts #-}++-------------------------------------------------------------------------------+-- Generics+-------------------------------------------------------------------------------++-- | Implement 'plate' operation for a type using its 'Generic' instance.+gplate :: (Generic a, GPlated a (Rep a)) => Traversal' a a+gplate f x = GHC.Generics.to <$> gplate' f (GHC.Generics.from x)+{-# INLINE gplate #-}++class GPlated a g where+  gplate' :: Traversal' (g p) a++instance GPlated a f => GPlated a (M1 i c f) where+  gplate' f (M1 x) = M1 <$> gplate' f x+  {-# INLINE gplate' #-}++instance (GPlated a f, GPlated a g) => GPlated a (f :+: g) where+  gplate' f (L1 x) = L1 <$> gplate' f x+  gplate' f (R1 x) = R1 <$> gplate' f x+  {-# INLINE gplate' #-}++instance (GPlated a f, GPlated a g) => GPlated a (f :*: g) where+  gplate' f (x :*: y) = (:*:) <$> gplate' f x <*> gplate' f y+  {-# INLINE gplate' #-}++instance OVERLAPPING_PRAGMA GPlated a (K1 i a) where+  gplate' f (K1 x) = K1 <$> f x+  {-# INLINE gplate' #-}++instance GPlated a (K1 i b) where+  gplate' _ = pure+  {-# INLINE gplate' #-}++instance GPlated a U1 where+  gplate' _ = pure+  {-# INLINE gplate' #-}++instance GPlated a V1 where+  gplate' _ v = v `seq` error "GPlated/V1"+  {-# INLINE gplate' #-}
src/Control/Lens/Prism.hs view
@@ -4,10 +4,15 @@ #ifdef TRUSTWORTHY {-# LANGUAGE Trustworthy #-} #endif++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Prism--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -55,10 +60,12 @@ import Data.Profunctor.Rep import Data.Traversable import Data.Void-#ifndef SAFE-import Unsafe.Coerce-#else+#if MIN_VERSION_base(4,7,0)+import Data.Coerce+#elif defined(SAFE) import Data.Profunctor.Unsafe+#else+import Unsafe.Coerce #endif import Prelude @@ -89,7 +96,10 @@  -- | Convert 'APrism' to the pair of functions that characterize it. withPrism :: APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r-#ifdef SAFE+#if MIN_VERSION_base(4,7,0)+withPrism k f = case coerce (k (Market Identity Right)) of+  Market bt seta -> f bt seta+#elif defined(SAFE) withPrism k f = case k (Market Identity Right) of   Market bt seta -> f (runIdentity #. bt) (either (Left . runIdentity) Right . seta) #else@@ -160,6 +170,12 @@ {-# INLINE aside #-}  -- | 'lift' a 'Prism' through a 'Traversable' functor, giving a Prism that matches only if all the elements of the container match the 'Prism'.+--+-- >>> [Left 1, Right "foo", Left 4, Right "woot"]^..below _Right+-- []+--+-- >>> [Right "hail hydra!", Right "foo", Right "blah", Right "woot"]^..below _Right+-- [["hail hydra!","foo","blah","woot"]] below :: Traversable f => APrism' s a -> Prism' (f s) (f a) below k =   withPrism k     $ \bt seta ->
src/Control/Lens/Reified.hs view
@@ -5,7 +5,7 @@ ------------------------------------------------------------------------------ -- | -- Module      :  Control.Lens.Reified--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Lens/Review.hs view
@@ -6,7 +6,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Review--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -116,7 +116,7 @@ -- 're' :: 'Prism' s t a b -> 'Getter' b t -- 're' :: 'Iso' s t a b   -> 'Getter' b t -- @-re :: AReview t b -> Getter b t+re :: Contravariant f => AReview t b -> LensLike' f b t re p = to (runIdentity #. unTagged #. p .# Tagged .# Identity) {-# INLINE re #-} @@ -141,8 +141,8 @@ -- 'review' :: 'Prism'' s a -> a -> s -- @ ----- However, when working with a 'Monad' transformer stack, it is sometimes useful to be able to 'review' the current environment, in which case one of--- these more slightly more liberal type signatures may be beneficial to think of it as having:+-- However, when working with a 'Monad' transformer stack, it is sometimes useful to be able to 'review' the current environment, in which case+-- it may be beneficial to think of it as having one of these slightly more liberal type signatures: -- -- @ -- 'review' :: 'MonadReader' a m => 'Iso'' s a   -> m s@@ -201,8 +201,8 @@ -- 'reviews' :: 'Prism'' s a -> (s -> r) -> a -> r -- @ ----- However, when working with a 'Monad' transformer stack, it is sometimes useful to be able to 'review' the current environment, in which case one of--- these more slightly more liberal type signatures may be beneficial to think of it as having:+-- However, when working with a 'Monad' transformer stack, it is sometimes useful to be able to 'review' the current environment, in which case+-- it may be beneficial to think of it as having one of these slightly more liberal type signatures: -- -- @ -- 'reviews' :: 'MonadReader' a m => 'Iso'' s a   -> (s -> r) -> m r
src/Control/Lens/Setter.hs view
@@ -9,7 +9,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Setter--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -63,9 +63,9 @@   -- * Simplified State Setting   , set'   -- * Indexed Setters-  , imapOf, iover+  , imapOf, iover, iset   , isets-  , (%@~), (%@=)+  , (%@~), (.@~), (%@=), (.@=)   -- * Arrow operators   , assignA   -- * Exported for legible error messages@@ -110,8 +110,8 @@ -- >>> let setter :: Expr -> Expr -> Expr; setter = fun "setter" -- >>> :set -XNoOverloadedStrings -infixr 4 %@~, .~, +~, *~, -~, //~, ^~, ^^~, **~, &&~, <>~, ||~, %~, <.~, ?~, <?~-infix  4 %@=, .=, +=, *=, -=, //=, ^=, ^^=, **=, &&=, <>=, ||=, %=, <.=, ?=, <?=+infixr 4 %@~, .@~, .~, +~, *~, -~, //~, ^~, ^^~, **~, &&~, <>~, ||~, %~, <.~, ?~, <?~+infix  4 %@=, .@=, .=, +=, *=, -=, //=, ^=, ^^=, **=, &&=, <>=, ||=, %=, <.=, ?=, <?= infixr 2 <~  ------------------------------------------------------------------------------@@ -1126,6 +1126,23 @@ iover l = over l .# Indexed {-# INLINE iover #-} +-- | Set with index. Equivalent to 'iover' with the current value ignored.+--+-- When you do not need access to the index, then 'set' is more liberal in what it can accept.+--+-- @+-- 'set' l ≡ 'iset' l '.' 'const'+-- @+--+-- @+-- 'iset' :: 'IndexedSetter' i s t a b    -> (i -> b) -> s -> t+-- 'iset' :: 'IndexedLens' i s t a b      -> (i -> b) -> s -> t+-- 'iset' :: 'IndexedTraversal' i s t a b -> (i -> b) -> s -> t+-- @+iset :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t+iset l = iover l . (const .)+{-# INLINE iset #-}+ -- | Build an 'IndexedSetter' from an 'Control.Lens.Indexed.imap'-like function. -- -- Your supplied function @f@ is required to satisfy:@@ -1152,10 +1169,10 @@ -- with access to the index. -- -- @--- ('%@~') ≡ 'imapOf'+-- ('%@~') ≡ 'iover' -- @ ----- When you do not need access to the index then ('%@~') is more liberal in what it can accept.+-- When you do not need access to the index then ('%~') is more liberal in what it can accept. -- -- @ -- l '%~' f ≡ l '%@~' 'const' f@@ -1170,6 +1187,28 @@ l %@~ f = l %~ Indexed f {-# INLINE (%@~) #-} +-- | Replace every target of an 'IndexedSetter', 'IndexedLens' or 'IndexedTraversal'+-- with access to the index.+--+-- @+-- ('.@~') ≡ 'iset'+-- @+--+-- When you do not need access to the index then ('.~') is more liberal in what it can accept.+--+-- @+-- l '.~' b ≡ l '.@~' 'const' b+-- @+--+-- @+-- ('.@~') :: 'IndexedSetter' i s t a b    -> (i -> b) -> s -> t+-- ('.@~') :: 'IndexedLens' i s t a b      -> (i -> b) -> s -> t+-- ('.@~') :: 'IndexedTraversal' i s t a b -> (i -> b) -> s -> t+-- @+(.@~) :: AnIndexedSetter i s t a b -> (i -> b) -> s -> t+l .@~ f = l %~ Indexed (const . f)+{-# INLINE (.@~) #-}+ -- | Adjust every target in the current state of an 'IndexedSetter', 'IndexedLens' or 'IndexedTraversal' -- with access to the index. --@@ -1187,6 +1226,24 @@ (%@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> a -> b) -> m () l %@= f = State.modify (l %@~ f) {-# INLINE (%@=) #-}++-- | Replace every target in the current state of an 'IndexedSetter', 'IndexedLens' or 'IndexedTraversal'+-- with access to the index.+--+-- When you do not need access to the index then ('.=') is more liberal in what it can accept.+--+-- @+-- l '.=' b ≡ l '.@=' 'const' b+-- @+--+-- @+-- ('.@=') :: 'MonadState' s m => 'IndexedSetter' i s s a b    -> (i -> b) -> m ()+-- ('.@=') :: 'MonadState' s m => 'IndexedLens' i s s a b      -> (i -> b) -> m ()+-- ('.@=') :: 'MonadState' s m => 'IndexedTraversal' i s t a b -> (i -> b) -> m ()+-- @+(.@=) :: MonadState s m => AnIndexedSetter i s s a b -> (i -> b) -> m ()+l .@= f = State.modify (l .@~ f)+{-# INLINE (.@=) #-}  ------------------------------------------------------------------------------ -- Arrows
src/Control/Lens/TH.hs view
@@ -10,7 +10,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.TH--- Copyright   :  (C) 2012-14 Edward Kmett, Michael Sloan+-- Copyright   :  (C) 2012-15 Edward Kmett, 2012-13 Michael Sloan -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -26,7 +26,6 @@   , makeClassyPrisms   , makeWrapped   , makeFields-  , makeFieldsWith   -- * Constructing Lenses Given a Declaration Quote   , declareLenses, declareLensesFor   , declareClassy, declareClassyFor@@ -52,6 +51,7 @@   , createClass   , generateSignatures   , generateUpdateableOptics+  , generateLazyPatterns   ) where  import Control.Applicative@@ -109,6 +109,23 @@ generateUpdateableOptics f r =   fmap (\x -> r { _allowUpdates = x}) (f (_allowUpdates r)) +-- | Generate optics using lazy pattern matches. This can+-- allow fields of an undefined value to be initialized with lenses,+-- and is the default behavior.+--+-- The downside of this flag is that it can lead to space-leaks and+-- code-size/compile-time increases when generated for large records.+--+-- When using lazy optics the strict optic can be recovered by composing+-- with '$!'+--+-- @+-- strictOptic = ($!) . lazyOptic+-- @+generateLazyPatterns :: Lens' LensRules Bool+generateLazyPatterns f r =+  fmap (\x -> r { _lazyPatterns = x}) (f (_lazyPatterns r))+ -- | Create the class if the constructor is 'Control.Lens.Type.Simple' and the -- 'lensClass' rule matches. createClass :: Lens' LensRules Bool@@ -147,6 +164,7 @@   , _generateClasses = False   , _allowIsos       = True   , _allowUpdates    = True+  , _lazyPatterns    = False   , _classyLenses    = const Nothing   , _fieldToDef      = \_ _ n ->        case nameBase n of@@ -173,6 +191,7 @@   , _generateClasses = True   , _allowIsos       = False -- generating Isos would hinder "subtyping"   , _allowUpdates    = True+  , _lazyPatterns    = False   , _classyLenses    = \n ->         case nameBase n of           x:xs -> Just (mkName ("Has" ++ x:xs), mkName (toLower x:xs))@@ -667,11 +686,6 @@ makeFields :: Name -> DecsQ makeFields = makeFieldOptics camelCaseFields --- | Deprecated alias for 'makeLensesWith'-makeFieldsWith :: LensRules -> Name -> DecsQ-makeFieldsWith = makeLensesWith-{-# DEPRECATED makeFieldsWith "Use `makeLensesWith`, functionality merged" #-}- defaultFieldRules :: LensRules defaultFieldRules = LensRules   { _simpleLenses    = True@@ -679,6 +693,7 @@   , _generateClasses = True  -- classes will still be skipped if they already exist   , _allowIsos       = False -- generating Isos would hinder field class reuse   , _allowUpdates    = True+  , _lazyPatterns    = False   , _classyLenses    = const Nothing   , _fieldToDef      = camelCaseNamer   }
src/Control/Lens/Traversal.hs view
@@ -17,7 +17,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Traversal--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -121,6 +121,9 @@   , Bazaar1(..), Bazaar1'   , loci   , iloci++  -- * Fusion+  , confusing   ) where  import Control.Applicative as Applicative@@ -138,6 +141,8 @@ import Control.Monad.Trans.State.Lazy import Data.Bitraversable import Data.Functor.Compose+import Data.Functor.Kan.Rift+import Data.Functor.Yoneda import Data.Int import Data.IntMap as IntMap import Data.Map as Map@@ -1216,3 +1221,41 @@           [] -> r go s           xs -> unsafeOuts b <$> traverse (corep pafb) xs           where b = l sell s++-- | "Fuse" a 'Traversal' by reassociating all of the '<*>' operations to the+-- left and fusing all of the 'fmap' calls into one. This is particularly+-- useful when constructing a 'Traversal' using operations from GHC.Generics.+--+-- Given a pair of 'Traversal's 'foo' and 'bar',+--+-- @+-- 'confusing' (foo.bar) = foo.bar+-- @+--+-- However, @foo@ and @bar@ are each going to use the 'Applicative' they are given.+--+-- 'confusing' exploits the 'Yoneda' lemma to merge their separate uses of 'fmap' into a single 'fmap'.+-- and it further exploits an interesting property of the right Kan lift (or 'Rift') to left associate+-- all of the uses of '(<*>)' to make it possible to fuse together more fmaps.+--+-- This is particularly effective when the choice of functor 'f' is unknown at compile+-- time or when the 'Traversal' @foo.bar@ in the above description is recursive or complex+-- enough to prevent inlining.+--+-- 'Control.Lens.Lens.fusing' is a version of this combinator suitable for fusing lenses.+--+-- @+-- 'confusing' :: 'Traversal' s t a b -> 'Traversal' s t a b+-- @+confusing :: Applicative f => LensLike (Rift (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b+confusing t = \f -> lowerYoneda . lowerRift . t (liftRiftYoneda . f)+  where+  liftRiftYoneda :: Applicative f => f a -> Rift (Yoneda f) (Yoneda f) a+  liftRiftYoneda fa = Rift (`yap` fa)+  {-# INLINE liftRiftYoneda #-}++  yap :: Applicative f => Yoneda f (a -> b) -> f a -> Yoneda f b+  yap (Yoneda k) fa = Yoneda (\ab_r -> k (ab_r .) <*> fa)+  {-# INLINE yap #-}++{-# INLINE confusing #-}
src/Control/Lens/Tuple.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-}+{-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE EmptyDataDecls #-}@@ -14,7 +15,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Tuple--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -33,6 +34,8 @@   , Field7(..)   , Field8(..)   , Field9(..)+  -- * Strict variations+  , _1', _2', _3', _4', _5', _6', _7', _8', _9'   ) where  import Control.Applicative@@ -384,6 +387,54 @@ instance Field9 (a,b,c,d,e,f,g,h,i) (a,b,c,d,e,f,g,h,i') i i' where   _9 k ~(a,b,c,d,e,f,g,h,i) = k i <&> \i' -> (a,b,c,d,e,f,g,h,i')   {-# INLINE _9 #-}++-- Strict versions of the _1 .. _9 operations++-- | Strict version of '_1'+_1' :: Field1 s t a b => Lens s t a b+_1' = \f !x -> _1 f x+{-# INLINE _1' #-}++-- | Strict version of '_2'+_2' :: Field2 s t a b => Lens s t a b+_2' = \f !x -> _2 f x+{-# INLINE _2' #-}++-- | Strict version of '_3'+_3' :: Field3 s t a b => Lens s t a b+_3' = \f !x -> _3 f x+{-# INLINE _3' #-}++-- | Strict version of '_4'+_4' :: Field4 s t a b => Lens s t a b+_4' = \f !x -> _4 f x+{-# INLINE _4' #-}++-- | Strict version of '_5'+_5' :: Field5 s t a b => Lens s t a b+_5' = \f !x -> _5 f x+{-# INLINE _5' #-}++-- | Strict version of '_6'+_6' :: Field6 s t a b => Lens s t a b+_6' = \f !x -> _6 f x+{-# INLINE _6' #-}++-- | Strict version of '_7'+_7' :: Field7 s t a b => Lens s t a b+_7' = \f !x -> _7 f x+{-# INLINE _7' #-}++-- | Strict version of '_8'+_8' :: Field8 s t a b => Lens s t a b+_8' = \f !x -> _8 f x+{-# INLINE _8' #-}++-- | Strict version of '_9'+_9' :: Field9 s t a b => Lens s t a b+_9' = \f !x -> _9 f x+{-# INLINE _9' #-}+  ix :: (Generic s, Generic t, GIxed n (Rep s) (Rep t) a b) => f n -> Lens s t a b ix n f = fmap to . gix n f . from
src/Control/Lens/Type.hs view
@@ -9,7 +9,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Type--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -336,15 +336,15 @@ -- -- There are two laws that a 'Prism' should satisfy: ----- First, if I 'Control.Lens.Review.re' or 'Control.Lens.Prism.review' a value with a 'Prism' and then 'Control.Lens.Fold.preview' or use ('Control.Lens.Fold.^?'), I will get it back:+-- First, if I 'Control.Lens.Review.re' or 'Control.Lens.Review.review' a value with a 'Prism' and then 'Control.Lens.Fold.preview' or use ('Control.Lens.Fold.^?'), I will get it back: -- -- @--- 'Control.Lens.Fold.preview' l ('Control.Lens.Prism.review' l b) ≡ 'Just' b+-- 'Control.Lens.Fold.preview' l ('Control.Lens.Review.review' l b) ≡ 'Just' b -- @ -- -- Second, if you can extract a value @a@ using a 'Prism' @l@ from a value @s@, then the value @s@ is completely described by @l@ and @a@: ----- If @'Control.Lens.Fold.preview' l s ≡ 'Just' a@ then @'Control.Lens.Prism.review' l a ≡ s@+-- If @'Control.Lens.Fold.preview' l s ≡ 'Just' a@ then @'Control.Lens.Review.review' l a ≡ s@ -- -- These two laws imply that the 'Traversal' laws hold for every 'Prism' and that we 'Data.Traversable.traverse' at most 1 element: --
src/Control/Lens/Wrapped.hs view
@@ -16,7 +16,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Wrapped--- Copyright   :  (C) 2012-14 Edward Kmett, Michael Sloan+-- Copyright   :  (C) 2012-15 Edward Kmett, Michael Sloan -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -579,7 +579,7 @@ failedAssertion (AssertionFailed x) = x {-# INLINE failedAssertion #-} -getArrowMonad :: ArrowApply m  => ArrowMonad m a -> m () a+getArrowMonad :: ArrowMonad m a -> m () a getArrowMonad (ArrowMonad x) = x {-# INLINE getArrowMonad #-} 
src/Control/Lens/Zoom.hs view
@@ -16,7 +16,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Control.Lens.Zoom--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -41,9 +41,7 @@ import Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.RWS.Strict as Strict import Control.Monad.Trans.Error-#if MIN_VERSION_mtl(2,2,0) import Control.Monad.Trans.Except-#endif import Control.Monad.Trans.List import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe@@ -74,7 +72,7 @@   -- This is commonly used to lift actions in a simpler 'State'   -- 'Monad' into a 'State' 'Monad' with a larger 'State' type.   ---  -- When applied to a 'Simple' 'Control.Lens.Traversal.Traversal' over+  -- When applied to a 'Control.Lens.Traversal.Traversal'' over   -- multiple values, the actions for each target are executed sequentially   -- and the results are aggregated.   --@@ -150,11 +148,9 @@   zoom l = ErrorT . liftM getErr . zoom (\afb -> unfocusingErr #. l (FocusingErr #. afb)) . liftM Err . runErrorT   {-# INLINE zoom #-} -#if MIN_VERSION_mtl(2,2,0) instance Zoom m n s t => Zoom (ExceptT e m) (ExceptT e n) s t where   zoom l = ExceptT . liftM getErr . zoom (\afb -> unfocusingErr #. l (FocusingErr #. afb)) . liftM Err . runExceptT   {-# INLINE zoom #-}-#endif  -- TODO: instance Zoom m m a a => Zoom (ContT r m) (ContT r m) a a where 
src/Control/Monad/Error/Lens.hs view
@@ -4,7 +4,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Error.Lens--- Copyright   :  (C) 2014 Edward Kmett+-- Copyright   :  (C) 2014-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Monad/Primitive/Lens.hs view
@@ -1,16 +1,10 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE TypeFamilies #-}--#ifndef MIN_VERSION_primitive-#define MIN_VERSION_primitive(x,y,z) 1-#endif- ----------------------------------------------------------------------------- -- | -- Module      :  Control.Monad.Primitive.Lens--- Copyright   :  (C) 2014 Edward Kmett+-- Copyright   :  (C) 2014-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -23,15 +17,11 @@   ) where  import Control.Lens-import Control.Monad.Primitive+import Control.Monad.Primitive (PrimMonad(..)) import GHC.Prim (State#)  {-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} -#if MIN_VERSION_primitive(0,6,0)-prim :: PrimBase m => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #))-#else-prim :: PrimMonad m => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #))-#endif+prim :: (PrimMonad m) => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #)) prim = iso internal primitive {-# INLINE prim #-}
src/Control/Parallel/Strategies/Lens.hs view
@@ -8,7 +8,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Parallel.Strategies.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Control/Seq/Lens.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Control.Seq.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Data/Array/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Array.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Data/Bits/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Bits.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/ByteString/Lazy/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.ByteString.Lazy.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/ByteString/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.ByteString.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/ByteString/Strict/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.ByteString.Strict.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -70,7 +70,7 @@ -- Note that when just using this as a 'Setter', @'setting' 'Data.ByteString.map'@ -- can be more efficient. bytes :: IndexedTraversal' Int ByteString Word8-bytes = traversedStrictTree 0+bytes = traversedStrictTree {-# INLINE bytes #-}  -- | 'Data.ByteString.Char8.pack' (or 'Data.ByteString.Char8.unpack') a list of characters into a 'ByteString'@@ -124,5 +124,5 @@ -- >>> anyOf chars (== 'h') "hello" -- True chars :: IndexedTraversal' Int ByteString Char-chars = traversedStrictTree8 0+chars = traversedStrictTree8 {-# INLINE chars #-}
src/Data/Complex/Lens.hs view
@@ -1,12 +1,9 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-}-#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif ----------------------------------------------------------------------------- -- | -- Module      :  Data.Complex.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -41,11 +38,7 @@ -- a * 2 :+ b -- -- @'_realPart' :: 'Functor' f => (a -> f a) -> 'Complex' a -> f ('Complex' a)@-#if MIN_VERSION_base(4,4,0) _realPart :: Lens' (Complex a) a-#else-_realPart :: RealFloat a => Lens' (Complex a) a-#endif _realPart f (a :+ b) = (:+ b) <$> f a {-# INLINE _realPart #-} @@ -58,11 +51,7 @@ -- a :+ b * 2 -- -- @'_imagPart' :: 'Functor' f => (a -> f a) -> 'Complex' a -> f ('Complex' a)@-#if MIN_VERSION_base(4,4,0) _imagPart :: Lens' (Complex a) a-#else-_imagPart :: RealFloat a => Lens' (Complex a) a-#endif _imagPart f (a :+ b) = (a :+) <$> f b {-# INLINE _imagPart #-} 
src/Data/Data/Lens.hs view
@@ -17,7 +17,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Data.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett, (C) 2006-2012 Neil Mitchell+-- Copyright   :  (C) 2012-2015 Edward Kmett, (C) 2006-2012 Neil Mitchell -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -401,7 +401,7 @@ -------------------------------------------------------------------------------  -biplateData :: forall f s a. (Applicative f, Data s, Typeable a) => (forall c. Typeable c => c -> Answer c a) -> (a -> f a) -> s -> f s+biplateData :: forall f s a. (Applicative f, Data s) => (forall c. Typeable c => c -> Answer c a) -> (a -> f a) -> s -> f s biplateData o f a0 = go2 a0 where   go :: Data d => d -> f d   go s = gfoldl (\x y -> x <*> go2 y) pure s@@ -412,7 +412,7 @@     Miss   -> pure s {-# INLINE biplateData #-} -uniplateData :: forall f s a. (Applicative f, Data s, Typeable a) => (forall c. Typeable c => c -> Answer c a) -> (a -> f a) -> s -> f s+uniplateData :: forall f s a. (Applicative f, Data s) => (forall c. Typeable c => c -> Answer c a) -> (a -> f a) -> s -> f s uniplateData o f a0 = go a0 where   go :: Data d => d -> f d   go s = gfoldl (\x y -> x <*> go2 y) pure s
src/Data/Dynamic/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Dynamic.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/HashSet/Lens.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.HashSet.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -33,7 +33,7 @@ -- -- Sadly, you can't create a valid 'Traversal' for a 'Set', but you can -- manipulate it by reading using 'Control.Lens.Fold.folded' and reindexing it via 'setmapped'.-setmapped :: (Eq i, Hashable i, Eq j, Hashable j) => IndexPreservingSetter (HashSet i) (HashSet j) i j+setmapped :: (Eq j, Hashable j) => IndexPreservingSetter (HashSet i) (HashSet j) i j setmapped = setting HashSet.map {-# INLINE setmapped #-} 
src/Data/IntSet/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.IntSet.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Data/List/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.List.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -16,9 +16,6 @@   ( prefixed   , suffixed   , stripSuffix-  -- * Deprecated-  , strippingPrefix-  , strippingSuffix   ) where  import Control.Monad (guard)@@ -78,16 +75,3 @@     go xs [] = zipWith const xs0 zs <$ guard (xs == qs)     go [] _  = Nothing -- impossible {-# INLINE stripSuffix #-}---- | This is a deprecated alias for 'prefixed'.-strippingPrefix :: Eq a => [a] -> Prism' [a] [a]-strippingPrefix = prefixed-{-# INLINE strippingPrefix #-}-{-# DEPRECATED strippingPrefix "Use 'prefixed'." #-}---- | This is a deprecated alias for 'suffixed'.-strippingSuffix :: Eq a => [a] -> Prism' [a] [a]-strippingSuffix = suffixed-{-# INLINE strippingSuffix #-}-{-# DEPRECATED strippingSuffix "Use 'suffixed'." #-}-
− src/Data/List/Split/Lens.hs
@@ -1,199 +0,0 @@-{-# LANGUAGE Rank2Types #-}-------------------------------------------------------------------------------- |--- Module      :  Data.List.Split.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett, Alexander Altman--- License     :  BSD-style (see the file LICENSE)--- Maintainer  :  Edward Kmett <ekmett@gmail.com>--- Stability   :  provisional--- Portability :  Rank2Types------ Lenses for working with Data.List.Split---------------------------------------------------------------------------------module Data.List.Split.Lens-  (-  -- * Splitting Folds-    splitting-  , splittingOn-  , splittingOneOf-  , splittingWhen-  , endingBy-  , endingByOneOf-  , wordingBy-  , liningBy-  , chunking-  , splittingPlaces-  , splittingPlacesBlanks-  -- * Lenses for 'Splitter' Internals-  , delimiters-  , delimiting-  , condensing-  , keepInitialBlanks-  , keepFinalBlanks-  ) where--import Control.Lens-import Data.Monoid-import Data.List.Split-import Data.List.Split.Internals---- $setup--- >>> :set -XNoOverloadedStrings--- >>> import Control.Lens--- >>> import Numeric.Lens (hex)--- >>> import Data.Char (chr)---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' according to the given splitting strategy.------ @--- 'splitting' :: 'Splitter' a -> 'Fold' s a -> 'Fold' s [a]--- @-splitting :: Splitter a -> Getting (Endo [a]) s a -> Fold s [a]-splitting s l f = coerce . traverse f . split s . toListOf l-{-# INLINE splitting #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' on the given delimiter.------ Equivalent to @'splitting' '.' 'dropDelims' '.' 'onSublist'@.------ @--- 'splittingOn' :: 'Eq' a => [a] -> 'Fold' s a -> 'Fold' s [a]--- @-splittingOn :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]-splittingOn s l f = coerce . traverse f . splitOn s . toListOf l-{-# INLINE splittingOn #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' on any of the given elements.------ Equivalent to @'splitting' '.' 'dropDelims' '.' 'oneOf'@.------ @--- 'splittingOn' :: 'Eq' a => [a] -> 'Fold' s a -> 'Fold' s [a]--- @-splittingOneOf :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]-splittingOneOf s l f = coerce . traverse f . splitOneOf s . toListOf l-{-# INLINE splittingOneOf #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' on elements satisfying the given predicate.------ Equivalent to @'splitting' '.' 'dropDelims' '.' 'whenElt'@.------ @--- 'splittingWhen' :: (a -> 'Bool') -> 'Fold' s a -> 'Fold' s [a]--- @-splittingWhen :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]-splittingWhen s l f = coerce . traverse f . splitWhen s . toListOf l-{-# INLINE splittingWhen #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into chunks terminated by the given delimiter.------ Equivalent to @'splitting' '.' 'dropDelims' '.' 'onSublist'@.------ @--- 'endingBy' :: 'Eq' a => [a] -> 'Fold' s a -> 'Fold' s [a]--- @-endingBy :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]-endingBy s l f = coerce . traverse f . endBy s . toListOf l-{-# INLINE endingBy #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into chunks terminated by any of the given elements.------ Equivalent to @'splitting' '.' 'dropFinalBlank' '.' 'dropDelims' '.' 'oneOf'@.------ @--- 'endingByOneOf' :: 'Eq' a => [a] -> 'Fold' s a -> 'Fold' s [a]--- @-endingByOneOf :: Eq a => [a] -> Getting (Endo [a]) s a -> Fold s [a]-endingByOneOf s l f = coerce . traverse f . endByOneOf s . toListOf l-{-# INLINE endingByOneOf #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into "words", with word boundaries indicated by the given predicate.------ Equivalent to @'splitting' '.' 'dropBlanks' '.' 'dropDelims' '.' 'whenElt'@.------ @--- 'wordingBy' :: (a -> 'Bool') -> 'Fold' s a -> 'Fold' s [a]--- @-wordingBy :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]-wordingBy s l f = coerce . traverse f . wordsBy s . toListOf l-{-# INLINE wordingBy #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into "lines", with line boundaries indicated by the given predicate.------ Equivalent to @'splitting' '.' 'dropFinalBlank' '.' 'dropDelims' '.' 'whenElt'@.------ @--- 'liningBy' :: (a -> 'Bool') -> 'Fold' s a -> 'Fold' s [a]--- @-liningBy :: (a -> Bool) -> Getting (Endo [a]) s a -> Fold s [a]-liningBy s l f = coerce . traverse f . linesBy s . toListOf l-{-# INLINE liningBy #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into length-@n@ pieces.------ >>> "48656c6c6f20776f726c64"^..chunking 2 folded.hex.to chr--- "Hello world"------ @--- 'chunking' :: 'Int' -> 'Fold' s a -> 'Fold' s [a]--- @-chunking :: Int -- ^ @n@-            -> Getting (Endo [a]) s a -> Fold s [a]-chunking s l f = coerce . traverse f . chunksOf s . toListOf l-{-# INLINE chunking #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into chunks of the given lengths, .------ @--- 'splittingPlaces' :: 'Integral' n => [n] -> 'Fold' s a -> 'Fold' s [a]--- @-splittingPlaces :: Integral n => [n] -> Getting (Endo [a]) s a -> Fold s [a]-splittingPlaces s l f = coerce . traverse f . splitPlaces s . toListOf l-{-# INLINE splittingPlaces #-}---- | Obtain a 'Fold' by splitting another 'Fold', 'Lens', 'Getter' or 'Traversal' into chunks of the given lengths.  Unlike 'splittingPlaces', the output 'Fold' will always be the same length as the first input argument.------ @--- 'splittingPlacesBlanks' :: 'Integral' n => [n] -> 'Fold' s a -> 'Fold' s [a]--- @-splittingPlacesBlanks :: Integral n => [n] -> Getting (Endo [a]) s a -> Fold s [a]-splittingPlacesBlanks s l f = coerce . traverse f . splitPlacesBlanks s . toListOf l-{-# INLINE splittingPlacesBlanks #-}---- | Modify or retrieve the list of delimiters for a 'Splitter'.-delimiters :: Lens (Splitter a) (Splitter b) [a -> Bool] [b -> Bool]-delimiters f s@Splitter { delimiter = Delimiter ds } = f ds <&> \ds' -> s { delimiter = Delimiter ds' }-{-# INLINE delimiters #-}---- | Modify or retrieve the policy for what a 'Splitter' should do with delimiters.-delimiting :: Lens' (Splitter a) DelimPolicy-delimiting f s@Splitter { delimPolicy = p } = f p <&> \p' -> s { delimPolicy = p' }-{-# INLINE delimiting #-}---- | Modify or retrieve the policy for what a 'Splitter' should do about consecutive delimiters.-condensing :: Lens' (Splitter a) CondensePolicy-condensing f s@Splitter { condensePolicy = p } = f p <&> \p' -> s { condensePolicy = p' }-{-# INLINE condensing #-}---- | Modify or retrieve the policy for whether a 'Splitter' should drop an initial blank.-keepInitialBlanks :: Lens' (Splitter a) Bool-keepInitialBlanks f s@Splitter { initBlankPolicy = p } = f (keeps p) <&> \p' -> s { initBlankPolicy = end p' }-{-# INLINE keepInitialBlanks #-}---- | Modify or retrieve the policy for whether a 'Splitter' should drop a final blank.-keepFinalBlanks :: Lens' (Splitter a) Bool-keepFinalBlanks f s@Splitter { finalBlankPolicy = p } = f (keeps p) <&> \p' -> s { finalBlankPolicy = end p' }-{-# INLINE keepFinalBlanks #-}---- utilities--end :: Bool -> EndPolicy-end True  = KeepBlank-end False = DropBlank-{-# INLINE end #-}--keeps :: EndPolicy -> Bool-keeps KeepBlank = True-keeps DropBlank = False-{-# INLINE keeps #-}
src/Data/Map/Lens.hs view
@@ -1,4 +1,12 @@--- | One of most commonly-asked questions about this package is whether+-----------------------------------------------------------------------------+-- |+-- Copyright   :  (C) 2014-2015 Edward Kmett+-- License     :  BSD-style (see the file LICENSE)+-- Maintainer  :  Edward Kmett <ekmett@gmail.com>+-- Stability   :  experimental+-- Portability :  non-portable+--+-- One of most commonly-asked questions about this package is whether -- it provides lenses for working with 'Data.Map.Map'. It does, but their uses -- are perhaps obscured by their genericity. This module exists to provide -- documentation for them.@@ -50,6 +58,8 @@ -- -- >>> preview traverseMax $ Map.fromList [(5, "Saturn"), (6, "Uranus")] -- Just "Uranus"+--+----------------------------------------------------------------------------- module Data.Map.Lens () where -- $setup -- >>> import Control.Lens
src/Data/Sequence/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Sequence.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/Set/Lens.hs view
@@ -1,8 +1,13 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-}++#ifndef MIN_VERSION_containers+#define MIN_VERSION_containers(x,y,z) 1+#endif ----------------------------------------------------------------------------- -- | -- Module      :  Data.Set.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -32,7 +37,11 @@ -- -- >>> over setmapped (+1) (fromList [1,2,3,4]) -- fromList [2,3,4,5]+#if MIN_VERSION_containers(0,5,2)+setmapped :: Ord j => IndexPreservingSetter (Set i) (Set j) i j+#else setmapped :: (Ord i, Ord j) => IndexPreservingSetter (Set i) (Set j) i j+#endif setmapped = setting Set.map {-# INLINE setmapped #-} 
src/Data/Text/Lazy/Lens.hs view
@@ -4,7 +4,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Text.Lazy.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/Text/Lens.hs view
@@ -5,7 +5,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Text.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/Text/Strict/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Text.Strict.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/Tree/Lens.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Tree.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/Data/Typeable/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Data.Typeable.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Data/Vector/Generic/Lens.hs view
@@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Data.Vector.Generic.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -24,6 +24,7 @@   , asStream   , asStreamR   , cloned+  , converted   -- * Lenses   , sliced   -- * Traversal of individual indices@@ -33,7 +34,7 @@  import Control.Applicative import Control.Lens-import Data.List (nub)+import Control.Lens.Internal.List (ordinalNub) import Data.Monoid import Data.Vector.Generic as V hiding (zip, filter, indexed) import Data.Vector.Fusion.Stream (Stream)@@ -79,18 +80,18 @@ -- -- >>> Vector.fromList [0,8,15] ^. from vector -- [0,8,15]-vector :: Vector v a => Iso' [a] (v a)+vector :: (Vector v a, Vector v b) => Iso [a] [b] (v a) (v b) vector = iso fromList V.toList {-# INLINE vector #-}  -- | Convert a 'Vector' to a finite 'Stream' (or back.)-asStream :: Vector v a => Iso' (v a) (Stream a)+asStream :: (Vector v a, Vector v b) => Iso (v a) (v b) (Stream a) (Stream b) asStream = iso stream unstream {-# INLINE asStream #-}  -- | Convert a 'Vector' to a finite 'Stream' from right to left (or -- back.)-asStreamR :: Vector v a => Iso' (v a) (Stream a)+asStreamR :: (Vector v a, Vector v b) => Iso (v a) (v b) (Stream a) (Stream b) asStreamR = iso streamR unstreamR {-# INLINE asStreamR #-} @@ -112,8 +113,7 @@ -- >>> toListOf (ordinals [1,3,2,5,9,10]) $ Vector.fromList [2,4..40] -- [4,8,6,12,20,22] ordinals :: Vector v a => [Int] -> IndexedTraversal' Int (v a) a-ordinals is f v = fmap (v //) $ traverse (\i -> (,) i <$> indexed f i (v ! i)) $ nub $ filter (\i -> 0 <= i && i < l) is where-  l = length v+ordinals is f v = fmap (v //) $ traverse (\i -> (,) i <$> indexed f i (v ! i)) $ ordinalNub (length v) is {-# INLINE ordinals #-}  -- | Like 'ix' but polymorphic in the vector type.@@ -122,3 +122,7 @@   | 0 <= i && i < V.length v = f (v V.! i) <&> \a -> v V.// [(i, a)]   | otherwise                = pure v {-# INLINE vectorIx #-}++-- | Different vector implementations are isomorphic to each other.+converted :: (Vector v a, Vector w a, Vector v b, Vector w b) => Iso (v a) (v b) (w a) (w b)+converted = iso convert convert
src/Data/Vector/Lens.hs view
@@ -8,7 +8,7 @@ ------------------------------------------------------------------------------- -- | -- Module      :  Data.Vector.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional@@ -30,9 +30,9 @@  import Control.Applicative import Control.Lens+import Control.Lens.Internal.List (ordinalNub) import Data.Vector as Vector hiding (zip, filter, indexed) import Prelude hiding ((++), length, null, head, tail, init, last, map, reverse)-import Data.List (nub) import Data.Monoid  -- | @sliced i n@ provides a 'Lens' that edits the @n@ elements starting@@ -89,7 +89,5 @@ -- >>> toListOf (ordinals [1,3,2,5,9,10]) $ Vector.fromList [2,4..40] -- [4,8,6,12,20,22] ordinals :: [Int] -> IndexedTraversal' Int (Vector a) a-ordinals is f v = fmap (v //) $ traverse (\i -> (,) i <$> indexed f i (v ! i)) $ nub $ filter (\i -> 0 <= i && i < l) is where-  l = length v+ordinals is f v = fmap (v //) $ traverse (\i -> (,) i <$> indexed f i (v ! i)) $ ordinalNub (length v) is {-# INLINE ordinals #-}-
src/GHC/Generics/Lens.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  GHC.Generics.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Generics/Deriving/Lens.hs view
@@ -2,10 +2,11 @@ {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module      :  Generics.Deriving.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Language/Haskell/TH/Lens.hs view
@@ -10,7 +10,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Language.Haskell.TH.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
src/Numeric/Lens.hs view
@@ -2,7 +2,7 @@ -------------------------------------------------------------------------------- -- | -- Module      :  Numeric.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/System/Exit/Lens.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  System.Exit.Lens--- Copyright   :  (C) 2013-14 Edward Kmett+-- Copyright   :  (C) 2013-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  provisional
src/System/FilePath/Lens.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  System.FilePath.Lens--- Copyright   :  (C) 2012-14 Edward Kmett+-- Copyright   :  (C) 2012-15 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental@@ -50,7 +50,7 @@ {-# INLINE (</>~) #-}  --- | Modify the target(s) of a 'Simple' 'Lens', 'Iso', 'Setter' or 'Traversal' by adding a path.+-- | Modify the target(s) of a 'Lens'', 'Iso'', 'Setter'' or 'Traversal'' by adding a path. -- -- >>> execState (both </>= "bin") ("hello","world") -- ("hello/bin","world/bin")@@ -106,7 +106,7 @@ l <.>~ n = over l (<.> n) {-# INLINE (<.>~) #-} --- | Modify the target(s) of a 'Simple' 'Lens', 'Iso', 'Setter' or 'Traversal' by adding an extension.+-- | Modify the target(s) of a 'Lens'', 'Iso'', 'Setter'' or 'Traversal'' by adding an extension. -- -- >>> execState (both <.>= "txt") ("hello","world") -- ("hello.txt","world.txt")
src/System/IO/Error/Lens.hs view
@@ -4,7 +4,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  System.IO.Error.Lens--- Copyright   :  (C) 2012-2014 Edward Kmett+-- Copyright   :  (C) 2012-2015 Edward Kmett -- License     :  BSD-style (see the file LICENSE) -- Maintainer  :  Edward Kmett <ekmett@gmail.com> -- Stability   :  experimental
tests/properties.hs view
@@ -70,7 +70,7 @@ prop__Just                           = isPrism (_Just :: Prism' (Maybe Int) Int)  -- Data.List.Lens-prop_strippingPrefix s               = isPrism (strippingPrefix s :: Prism' String String)+prop_prefixed s                      = isPrism (prefixed s :: Prism' String String)  -- Data.Text.Lens prop_text s                          = s^.packed.from packed == s