7      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~            !!!!!!!!!!""###$$$$$$$$$$$$%%%%&&&&''(())))*++++, Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered'A concrete data type for isomorphisms. DThis lets you place an isomorphism inside a container without using ImpredicativeTypes. 7Used to provide overloading of isomorphism application  This is a ) with a canonical mapping to it from the . category of isomorphisms over Haskell types. *Build this morphism out of an isomorphism The intention is that by using #, you can supply both halves of an + isomorphism, but k can be instantiated to (->), so you can freely use * the resulting isomorphism as a function. MMap a morphism in the target category using an isomorphism between morphisms  in Hask. Invert an isomorphism. ENote to compose an isomorphism and receive an isomorphism in turn you'll need to use     from (from l) = l If you imported  from Control.Category, then:  from l . from r = from (r . l) Convert from an  back to any  value. WThis is useful when you need to store an isomoprhism as a data type inside a container 6 and later reconstitute it as an overloaded function.  Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered   is just a renamed  functor to give better error = messages when someone attempts to use a getter as a setter. 1Most user code will never need to see this type.  Anything   must be isomorphic to the  . An  K ignores its argument and is isomorphic to a monad wrapped around a value. 9That said, the monad is possibly rather unrelated to any  structure. Used instead of  to report  No instance of (, )#when the user attempts to misuse a - as a  Getter., rather than a monolithic unification error.  Generalizing  so we can apply simple  > transformations to it and so we can get nicer error messages A  4 ignores its argument, which it carries solely as a  phantom type parameter. To ensure this, an instance of  is required to satisfy:  =  f = #Replace the phantom type argument. OWrap a monadic effect with a phantom type argument. Used when magnifying RWST. 4Wrap a monadic effect with a phantom type argument. The Indexed Kleene Store comonad , aka the 'indexed cartesian store comonad' or an indexed FunList. This is used to characterize a ..  *http://twanvl.nl/blog/haskell/non-regular1 Used to find the nth / of a .. !!The result of trying to find the nth / of a .. % Used for  0 ( Used for  1 +Used internally by 2 and the like. .Used internally by 3 and the like. 1Applicative composition of 45  with a , used  by 6, 7, 8, 9 40The indexed store can be used to characterize a  :  and is used by  ; 6Used by  < to  = into >? 9Make a monoid out of  for error handling <Used by  < to  = into >? ?Make a monoid out of  for error handling BUsed by  < to  = into @A or BC EUsed by  < to  = into DE. HUsed by  < to  = into FG KUsed by  < to  = into HI NObtain the minimum. OObtain the maximum P@Given an action to run for each matched pair, traverse a store. Q.A convenient antonym that is used internally.  J so you can pass our a Setter, into combinators from other lens libraries 0This instance is a lie, but it is a useful lie. z  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ      !"#$%&'(I  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQI45KLMHIJEFGBCD6789:;<=>?@A./0+,-123(*)N%'&O !$#"PQ M    !$#"%'&(*)+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ      !"#$%&'("rank 2 types, MPTCs, TFs, flexible provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered RYA function with access to a index. This constructor may be useful when you need to store  a U in a container to avoid ImpredicativeTypes. U*Type alias for passing around polymorphic V functions that can be called T or  directly as a function VbPermit overloading of function application for things that also admit a notion of a key or index. Provides overloading for V functions. WBuild a function from an V function X Compose an V' function with a non-indexed function. Mnemonically, the <* points to the index we want to preserve. Y'Compose a non-indexed function with an V function. Mnemonically, the >* points to the index we want to preserve. ZRemap the index. [Composition of V functions Mnemonically, the  @ and @: points to the fact that we want to preserve the indices. \Composition of V> functions with a user supplied function for combining indexs )CUsing an equality witness to avoid potential overlapping instances  and aid dispatch. RSTUVWXYZ[\)* RSTUVWXYZ[\ VWURST[XY\Z RSTUVWXYZ[\)*rank 2 types, MPTCs experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered]Used to consume an K. ^Every ^ is a valid K and Getter. ]^]^^]]^"rank 2 types, MPTCs, TFs, flexible provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered_Every _ is a valid  L. `Fold an _ or M/ by mapping indices and values to an arbitrary + with access  to the index i.  When you don' t need access to the index then  N& is more flexible in what it accepts.   N l = ` l . ,   ifoldMapOf :: ^+ i a c -> (i -> c -> m) -> a -> m  ifoldMapOf :: + m => _- i a c -> (i -> c -> m) -> a -> m  ifoldMapOf ::  O' i a c -> (i -> c -> m) -> a -> m  ifoldMapOf :: + m => P" i a c -> (i -> c -> m) -> a -> m aJRight-associative fold of parts of a structure that are viewed through an _ or M with  access to the index i.  When you don' t need access to the index then  Q& is more flexible in what it accepts.   Q l = a l . ,   ifoldrOf :: ^5 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf :: _7 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf ::  O1 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf :: P, i a c -> (i -> c -> e -> e) -> e -> a -> e bMLeft-associative fold of the parts of a structure that are viewed through an _ or M with  access to the index i.  When you don' t need access to the index then  R& is more flexible in what it accepts.   R l = b l . ,   ifoldlOf :: ^5 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf :: _7 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf ::  O1 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf :: P, i a c -> (i -> e -> c -> e) -> e -> a -> e c4Return whether or not any element viewed through an _ or M / satisfy a predicate, with access to the index i.  When you don' t need access to the index then  S& is more flexible in what it accepts.   S l = c l . ,   ianyOf :: ^ i a c -> (i -> c -> - ) -> a -> -  ianyOf :: _ i a c -> (i -> c -> - ) -> a -> -  ianyOf ::  O i a c -> (i -> c -> - ) -> a -> -  ianyOf :: P i a c -> (i -> c -> - ) -> a -> - d5Return whether or not all elements viewed through an _ or M / satisfy a predicate, with access to the index i.  When you don' t need access to the index then  T& is more flexible in what it accepts.   T l = d l . ,   iallOf :: ^ i a c -> (i -> c -> - ) -> a -> -  iallOf :: _ i a c -> (i -> c -> - ) -> a -> -  iallOf ::  O i a c -> (i -> c -> - ) -> a -> -  iallOf :: P i a c -> (i -> c -> - ) -> a -> - eTraverse the targets of an _ or M with access to the index i, discarding the results.  When you don' t need access to the index then  3& is more flexible in what it accepts.   3 l =  itraverseOf l . ,   itraverseOf_ ::  f => ^0 i a c -> (i -> c -> f e) -> a -> f ()  itraverseOf_ ::  f => _2 i a c -> (i -> c -> f e) -> a -> f ()  itraverseOf_ ::  f =>  O, i a c -> (i -> c -> f e) -> a -> f ()  itraverseOf_ ::  f => P' i a c -> (i -> c -> f e) -> a -> f () fTraverse the targets of an _ or M2 with access to the index, discarding the results  (with the arguments flipped).  f = . . e When you don' t need access to the index then  U& is more flexible in what it accepts.   U l a = iforOf l a . ,   iforOf_ ::  f => ^0 i a c -> a -> (i -> c -> f e) -> f ()  iforOf_ ::  f => _2 i a c -> a -> (i -> c -> f e) -> f ()  iforOf_ ::  f =>  O, i a c -> a -> (i -> c -> f e) -> f ()  iforOf_ ::  f => P' i a c -> a -> (i -> c -> f e) -> f () g*Run monadic actions for each target of an _ or M with access to the index,  discarding the results.  When you don' t need access to the index then  V& is more flexible in what it accepts.   V l = imapMOf l . ,   imapMOf_ :: / m => ^0 i a c -> (i -> c -> m e) -> a -> m ()  imapMOf_ :: / m => _2 i a c -> (i -> c -> m e) -> a -> m ()  imapMOf_ :: / m =>  O, i a c -> (i -> c -> m e) -> a -> m ()  imapMOf_ :: / m => P' i a c -> (i -> c -> m e) -> a -> m () h*Run monadic actions for each target of an _ or M with access to the index, 6 discarding the results (with the arguments flipped).  h = . . g When you don' t need access to the index then  W& is more flexible in what it accepts.   W l a = iforMOf l a . ,   iforMOf_ :: / m => ^0 i a c -> a -> (i -> c -> m e) -> m ()  iforMOf_ :: / m => _2 i a c -> a -> (i -> c -> m e) -> m ()  iforMOf_ :: / m =>  O, i a c -> a -> (i -> c -> m e) -> m ()  iforMOf_ :: / m => P' i a c -> a -> (i -> c -> m e) -> m () i<Concatenate the results of a function of the elements of an _ or M  with access to the index.  When you don' t need access to the index then  X' is more flexible in what it accepts.   X l =  iconcatMapMOf l . ,   iconcatMapOf :: ^ i a c -> (i -> c -> [e] ) -> a -> [e]  iconcatMapOf :: _" i a c -> (i -> c -> [e] ) -> a -> [e]  iconcatMapOf ::  O i a c -> (i -> c -> [e] ) -> a -> [e]  iconcatMapOf :: P i a c -> (i -> c -> [e] ) -> a -> [e] jThe findOf function takes an _ or M, a predicate that is also T supplied the index, a structure and returns the left-most element of the structure  matching the predicate, or 0 if there is no such element.  When you don' t need access to the index then  Y& is more flexible in what it accepts.   Y l = ifoldOf l . ,   ifindOf :: ^ a c -> (i -> c -> - ) -> a ->  (i, c)  ifindOf :: _ a c -> (i -> c -> - ) -> a ->  (i, c)  ifindOf ::  O a c -> (i -> c -> - ) -> a ->  (i, c)  ifindOf :: P a c -> (i -> c -> - ) -> a ->  (i, c) kStrictly< fold right over the elements of a structure with an index.  When you don' t need access to the index then  Z& is more flexible in what it accepts.   Z l = k l . ,   ifoldrOf' :: ^5 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf' :: _7 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf' ::  O1 i a c -> (i -> c -> e -> e) -> e -> a -> e  ifoldrOf' :: P, i a c -> (i -> c -> e -> e) -> e -> a -> e lRFold over the elements of a structure with an index, associating to the left, but strictly.  When you don' t need access to the index then  [& is more flexible in what it accepts.   [ l = l l . ,   ifoldlOf' :: ^7 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf' :: _9 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf' ::  O3 i a c -> (i -> e -> c -> e) -> e -> a -> e  ifoldlOf' :: P. i a c -> (i -> e -> c -> e) -> e -> a -> e mCMonadic fold right over the elements of a structure with an index.  When you don' t need access to the index then  \& is more flexible in what it accepts.   \ l = m l . ,   ifoldrMOf :: / m => ^7 i a c -> (i -> c -> e -> m e) -> e -> a -> e  ifoldrMOf :: / m => _9 i a c -> (i -> c -> e -> m e) -> e -> a -> e  ifoldrMOf :: / m =>  O3 i a c -> (i -> c -> e -> m e) -> e -> a -> e  ifoldrMOf :: / m => P. i a c -> (i -> c -> e -> m e) -> e -> a -> e nVMonadic fold over the elements of a structure with an index, associating to the left.  When you don' t need access to the index then  ]& is more flexible in what it accepts.   ] l = n l . ,   ifoldlOf' :: / m => ^9 i a c -> (i -> e -> c -> m e) -> e -> a -> e  ifoldlOf' :: / m => _; i a c -> (i -> e -> c -> m e) -> e -> a -> e  ifoldlOf' :: / m =>  O5 i a c -> (i -> e -> c -> m e) -> e -> a -> e  ifoldlOf' :: / m => P0 i a c -> (i -> e -> c -> m e) -> e -> a -> e o.Extract the key-value pairs from a structure.  When you don'1t need access to the indices in the result, then  ^& is more flexible in what it accepts.   ^ l = 1 2 . o l   itoListOf :: ^ i a c -> a -> [(i,c)]  itoListOf :: _ i a c -> a -> [(i,c)]  itoListOf ::  O i a c -> a -> [(i,c)]  itoListOf :: P i a c -> a -> [(i,c)] p Obtain an _ by filtering a  _, ^, _ or M. q Obtain an _! by taking elements from another _,  _, ^ or M while a predicate holds. r Obtain an _# by dropping elements from another _,  _, ^ or M while a predicate holds. _`abcdefghijklmnopqr_`abcdefghijklmnopqr_`abcdefghijklmnopqr_`abcdefghijklmnopqrMTPCs, FDs, Rank2 experimentalEdward Kmett <ekmett@gmail.com> Safe-InferedsUsed to evaluate an u. tA t is a Fold enriched with access to a / for side-effects. Every Fold can be used as a t(, that simply ignores the access to the /. You can compose a t with another t using (3 ) from the Prelude. uAn u is a Getter enriched with access to a / for side-effects. Every Getter can be used as an u You can compose an u with another u using (3 ) from the Prelude. v Perform an u.  perform = flip (^!) w Perform an u import Control.Lens&["hello","world"]^!folded.act putStrLnhelloworldx Construct an u from a monadic side-effect yA self-running u, analogous to `a.  y = x 4import Control.Lens(1,"hello")^!_2.acts.to succ"ifmmp"zApply a / transformer to an u. stuvwxyzstuvwxyzuxyvzwtsstuvwxyz Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered"{0This is a useful alias for use when consuming a |. 1Most user code will never have to use this type. type { m =  b }|A Simple Setter is just a ~ that doesn't change the types. NThese are particularly common when talking about monomorphic containers. e.g.   Data.Text.map :: | cd 5 type | =  b ~} Running a ~% instantiates it to a concrete type. WWhen consuming a setter directly to perform a mapping, you can use this type, but most + user code will not need to use this type.  By choosing   rather than Identity, we get nicer error messages. ~ The only  :-like law that can apply to a ~ l is that   l c ( l b a) =  l c aYou can't view a ~3 in general, so the other two laws are irrelevant.  However, two  laws apply to a ~:     l 4 = 4   l f .  l g =  l (f . g) "These an be stated more directly:    l 6 = 6  l f .   . l g = l (f .   . g) You can compose a ~ with a  : or a . using (3) from the Prelude ! and the result is always only a ~ and nothing more. ;This setter can be used to map over all of the values in a .    =    ef =  eg  (7) =   )Build a Setter from a map-like function. Your supplied function f is required to satisfy:    f 4 = 4  f g 3 f h = f (g 3 h) Equational reasoning:     .  = 4   .  = 4 Another way to view  is that it takes a "semantic editor combinator"  and transforms it into a ~. Modify the target of a  : or all the targets of a ~ or .  with a function.     =    ef =  eg   .  = 4   .  = 4 Another way to view " is to say that it transformers a ~ into a  "semantic editor combinator".  :: ~ a b c d -> (c -> d) -> a -> bModify the target of a  : or all the targets of a ~ or . ' with a function. This is an alias for # that is provided for consistency.     =    =     fmapDefault =  traverse   .  = 4   .  = 4    mapOf :: ~$ a b c d -> (c -> d) -> a -> b  mapOf ::  h' a b c d -> (c -> d) -> a -> b  mapOf ::  :& a b c d -> (c -> d) -> a -> b  mapOf :: .! a b c d -> (c -> d) -> a -> b Replace the target of a  : or all of the targets of a ~  or . with a constant value.  (7) =  import Control.Lensset _2 "hello" (1,()) (1,"hello")set mapped () [1,2,3,4] [(),(),(),()]Note: Attempting to  a Fold or Getter# will fail at compile time with an  relatively nice error message.   set :: ~ a b c d -> d -> a -> b  set ::  h a b c d -> d -> a -> b  set ::  : a b c d -> d -> a -> b  set :: . a b c d -> d -> a -> b Modifies the target of a  : or all of the targets of a ~ or  . with a user supplied function. This is an infix version of      f =   f  ef f = traverse  f import Control.Lens_2 %~ length $ (1,"hello")(1,5)   (%~) :: ~" a b c d -> (c -> d) -> a -> b  (%~) ::  h% a b c d -> (c -> d) -> a -> b  (%~) ::  :$ a b c d -> (c -> d) -> a -> b  (%~) :: . a b c d -> (c -> d) -> a -> b Replace the target of a  : or all of the targets of a ~  or . with a constant value. This is an infix version of !, provided for consistency with ()  f 7 a =   f 8 aimport Control.Lens_1 .~ "hello" $ (42,"world")("hello","world")   (.~) :: ~ a b c d -> d -> a -> b  (.~) ::  h a b c d -> d -> a -> b  (.~) ::  : a b c d -> d -> a -> b  (.~) :: . a b c d -> d -> a -> b Set with pass-through WThis is mostly present for consistency, but may be useful for for chaining assignments AIf you do not need a copy of the intermediate result, then using l  d directly is a good idea.   (<.~) :: ~ a b c d -> d -> a -> (d, b)  (<.~) ::  h# a b c d -> d -> a -> (d, b)  (<.~) ::  :" a b c d -> d -> a -> (d, b)  (<.~) :: . a b c d -> d -> a -> (d, b) 0Increment the target(s) of a numerically valued  :, ~ or . import Control.Lens_1 +~ 1 $ (1,2)(2,2)   (+~) :: Num c => ~ a b c c -> c -> a -> b  (+~) :: Num c =>  h a b c c -> c -> a -> b  (+~) :: Num c =>  : a b c c -> c -> a -> b  (+~) :: Num c => . a b c c -> c -> a -> b /Multiply the target(s) of a numerically valued  :,  h, ~ or . import Control.Lens_2 *~ 4 $ (1,2)(1,8)   (*~) :: 9 c => ~ a b c c -> c -> a -> b  (*~) :: 9 c =>  h a b c c -> c -> a -> b  (*~) :: 9 c =>  : a b c c -> c -> a -> b  (*~) :: 9 c => . a b c c -> c -> a -> b 0Decrement the target(s) of a numerically valued  :,  h, ~ or . import Control.Lens_1 -~ 2 $ (1,2)(-1,2)   (-~) :: 9 c => ~ a b c c -> c -> a -> b  (-~) :: 9 c =>  h a b c c -> c -> a -> b  (-~) :: 9 c =>  : a b c c -> c -> a -> b  (-~) :: 9 c => . a b c c -> c -> a -> b -Divide the target(s) of a numerically valued  :,  h, ~ or .   (~) :: : c => ~ a b c c -> c -> a -> b  (~) :: : c =>  h a b c c -> c -> a -> b  (~) :: : c =>  : a b c c -> c -> a -> b  (~) :: : c => . a b c c -> c -> a -> b ,Raise the target(s) of a numerically valued  :, ~ or ." to a non-negative integral power import Control.Lens_2 ^~ 2 $ (1,3)(1,9)-Raise the target(s) of a fractionally valued  :, ~ or . to an integral power import Control.Lens_2 ^^~ (-1) $ (1,2)(1,0.5)   (^^~) :: (: c, ; e) => ~ a b c c -> e -> a -> b  (^^~) :: (: c, ; e) =>  h a b c c -> e -> a -> b  (^^~) :: (: c, ; e) =>  : a b c c -> e -> a -> b  (^^~) :: (: c, ; e) => . a b c c -> e -> a -> b /Raise the target(s) of a floating-point valued  :, ~ or . to an arbitrary power. import Control.Lens_2 **~ pi $ (1,3)(1,31.54428070019754)   (**~) :: < c => ~ a b c c -> c -> a -> b  (**~) :: < c =>  h a b c c -> c -> a -> b  (**~) :: < c =>  : a b c c -> c -> a -> b  (**~) :: < c => . a b c c -> c -> a -> b  Logically = the target(s) of a --valued  : or ~  :m + Control.Lens Data.Pair.Lensboth ||~ True $ (False,True) (True,True)both ||~ False $ (False,True) (False,True)   (||~):: ~ a b - - -> - -> a -> b  (||~)::  h a b - - -> - -> a -> b  (||~)::  : a b - - -> - -> a -> b  (||~):: . a b - - -> - -> a -> b  Logically > the target(s) of a --valued  : or ~  :m + Control.Lens Data.Pair.Lensboth &&~ True $ (False, True) (False,True)both &&~ False $ (False, True) (False,False)   (&&~):: ~ a b - - -> - -> a -> b  (&&~)::  h a b - - -> - -> a -> b  (&&~)::  : a b - - -> - -> a -> b  (&&~):: . a b - - -> - -> a -> b Replace the target of a  : or all of the targets of a ~ or . in our monadic 2 state with a new value, irrespective of the old.    (.=) :: ? a m =>  h" a a c d -> d -> m ()  (.=) :: ? a m =>  :! a a c d -> d -> m ()  (.=) :: ? a m => . a a c d -> d -> m ()  (.=) :: ? a m => ~ a a c d -> d -> m () 9It puts the state in the monad or it gets the hose again. Map over the target of a  : or all of the targets of a ~ or . in our monadic state.   (%=) :: ? a m =>  h) a a c d -> (c -> d) -> m ()  (%=) :: ? a m =>  :( a a c d -> (c -> d) -> m ()  (%=) :: ? a m => .# a a c d -> (c -> d) -> m ()  (%=) :: ? a m => ~& a a c d -> (c -> d) -> m () Modify the target(s) of a  b  :,  h, ~ or . by adding a value  Example:   $ fresh :: MonadState Int m => m Int  fresh = do  4  1  use 4    (+=) :: (? a m, 9 b) =>  b ~ a b -> b -> m ()  (+=) :: (? a m, 9 b) =>  b  h a b -> b -> m ()  (+=) :: (? a m, 9 b) =>  b  : a b -> b -> m ()  (+=) :: (? a m, 9 b) =>  b . a b -> b -> m () Modify the target(s) of a  b  :,  h, ~ or . by subtracting a value   (-=) :: (? a m, 9 b) =>  b ~ a b -> b -> m ()  (-=) :: (? a m, 9 b) =>  b  h a b -> b -> m ()  (-=) :: (? a m, 9 b) =>  b  : a b -> b -> m ()  (-=) :: (? a m, 9 b) =>  b . a b -> b -> m () Modify the target(s) of a  b  :,  h, ~ or . by multiplying by value.   ballSpeed 3 i  speedMultiplier   (*=) :: (? a m, 9 b) =>  b ~ a b -> b -> m ()  (*=) :: (? a m, 9 b) =>  b  h a b -> b -> m ()  (*=) :: (? a m, 9 b) =>  b  : a b -> b -> m ()  (*=) :: (? a m, 9 b) =>  b . a b -> b -> m () Modify the target(s) of a  b  :,  h, ~ or . by dividing by a value.   (=) :: (? a m, : b) =>  b ~ a b -> b -> m ()  (=) :: (? a m, : b) =>  b  h a b -> b -> m ()  (=) :: (? a m, : b) =>  b  : a b -> b -> m ()  (=) :: (? a m, : b) =>  b . a b -> b -> m () ,Raise the target(s) of a numerically valued  :, ~ or .# to a non-negative integral power.   (^=) :: (? a m, : b, ; c) =>  b ~ a b -> c -> m ()  (^=) :: (? a m, : b, ; c) =>  b  h a b -> c -> m ()  (^=) :: (? a m, : b, ; c) =>  b  : a b -> c -> m ()  (^=) :: (? a m, : b, ; c) =>  b . a b -> c -> m () ,Raise the target(s) of a numerically valued  :, ~ or . to an integral power.   (^^=) :: (? a m, : b, ; c) =>  b ~ a b -> c -> m ()  (^^=) :: (? a m, : b, ; c) =>  b  h a b -> c -> m ()  (^^=) :: (? a m, : b, ; c) =>  b  : a b -> c -> m ()  (^^=) :: (? a m, : b, ; c) =>  b . a b -> c -> m () ,Raise the target(s) of a numerically valued  :, ~ or . to an arbitrary power   (**=) :: (? a m, < b) =>  b ~ a b -> b -> m ()  (**=) :: (? a m, < b) =>  b  h a b -> b -> m ()  (**=) :: (? a m, < b) =>  b  : a b -> b -> m ()  (**=) :: (? a m, < b) =>  b . a b -> b -> m () Modify the target(s) of a  b  :,  h, ~ or . by taking their logical > with a value   (&&=):: ? a m =>  b ~ a - -> - -> m ()  (&&=):: ? a m =>  b  h a - -> - -> m ()  (&&=):: ? a m =>  b  : a - -> - -> m ()  (&&=):: ? a m =>  b . a - -> - -> m () Modify the target(s) of a  b  :, 'Iso, ~ or . by taking their logical = with a value   (||=):: ? a m =>  b ~ a - -> - -> m ()  (||=):: ? a m =>  b  h a - -> - -> m ()  (||=):: ? a m =>  b  : a - -> - -> m ()  (||=):: ? a m =>  b . a - -> - -> m () 6Run a monadic action, and set all of the targets of a  :, ~ or . to its result.    (<~) :: ? a m =>  h a a c d -> m d -> m ()  (<~) :: ? a m =>  : a a c d -> m d -> m ()  (<~) :: ? a m => . a a c d -> m d -> m ()  (<~) :: ? a m => ~ a a c d -> m d -> m () cAs a reasonable mnemonic, this lets you store the result of a monadic action in a lens rather than  in a local variable.   do foo <- bar  ... +will store the result in a variable, while   do foo <~ bar  ... will store the result in a  :, ~, or .. Set with pass-through XThis is useful for chaining assignment without round-tripping through your monad stack.  do x <- _2 <*.= ninety_nine_bottles_of_beer_on_the_wallAIf you do not need a copy of the intermediate result, then using l .= d$ will avoid unused binding warnings   (<.=) :: ? a m => ~ a a c d -> d -> m d  (<.=) :: ? a m =>  h a a c d -> d -> m d  (<.=) :: ? a m =>  : a a c d -> d -> m d  (<.=) :: ? a m => . a a c d -> d -> m d "{|}~"{|}~"~}{|"{|}~  Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered Most - combinators are able to be used with both a  or a   L2 in limited situations, to do so, they need to be 2 monomorphic in what we are going to extract with Const. To be compatible  with  :, . and   h. we also restricted choices of the irrelevant b and  d parameters. If a function accepts a  r a c , then when r is a Monoid, then  you can pass a  L (or  .&), otherwise you can only pass this a   or  :. A ? describes how to retrieve a single value in a way that can be . composed with other lens-like constructions.  Unlike a  : a  is read-only. Since a  L cannot be used to write back there are no lens laws that can be applied to = it. In fact, it is isomorphic to an arbitrary function from (a -> c).  Moreover, a  can be used directly as a  L,  since it just ignores the  Applicative. Build a % from an arbitrary Haskell function.   f .  g =  (g . f) a   f = f aimport Control.Lens(0, -5)^._2.to abs5View the value pointed to by a ,  h or   :4 or the result of folding over all the results of a   L or . that points  at a monoidal values.   .  = 4import Control.Lensview _2 (1,"hello")"hello"It may be useful to think of " as having these more restrictive  signatures:   view ::  a c -> a -> c  view :: Monoid m =>  L a m -> a -> m  view ::  b  h a c -> a -> c  view ::  b  : a c -> a -> c  view :: Monoid m =>  b . a m -> a -> m View the value of a ,  h,   :5 or the result of folding over the result of mapping  the targets of a  L or  .. It may be useful to think of " as having these more restrictive  signatures: import Control.Lensviews _2 length (1,"hello")5   views :: ' a c -> (c -> d) -> a -> d  views :: Monoid m =>  L) a c -> (c -> m) -> a -> m  views ::  b  h# a c -> (c -> d) -> a -> d  views ::  b  :" a c -> (c -> d) -> a -> d  views :: Monoid m =>  b . a c -> (c -> m) -> a -> m View the value pointed to by a ,  h or   :4 or the result of folding over all the results of a   L or . that points  at a monoidal values. This is the same operation as , only infix. import Control.Lens_2 ^$ (1, "hello")"hello"   (^$) ::  a c -> a -> c  (^$) :: Monoid m =>  L a m -> a -> m  (^$) ::  b  h a c -> a -> c  (^$) ::  b  : a c -> a -> c  (^$) :: Monoid m =>  b . a m -> a -> m View the value pointed to by a  or  : or the - result of folding over all the results of a  L or  .# that points at a monoidal values. This is the same operation as  with the arguments flipped. HThe fixity and semantics are such that subsequent field accesses can be  performed with (3) :m + Data.Complex Control.Lens$((0, 1 :+ 2), 3)^._1._2.to magnitude2.23606797749979   (^.) :: a ->  a c -> c  (^.) :: Monoid m => a ->  L a m -> m  (^.) :: a ->  b  h a c -> c  (^.) :: a ->  b  : a c -> c  (^.) :: Monoid m => a ->  b . a m -> m Use the target of a  :,  h, or  - in the current state, or use a summary of a   L or . that points  to a monoidal value.   use :: ? a m =>  a c -> m c  use :: (? a m, Monoid r) =>  L a r -> m r  use :: ? a m =>  b  h a c -> m c  use :: ? a m =>  b  : a c -> m c  use :: (? a m, Monoid r) =>  b . a r -> m r Use the target of a  :,  h or  - in the current state, or use a summary of a   L or . that  points to a monoidal value.   uses :: ? a m => " a c -> (c -> e) -> m e  uses :: (? a m, Monoid r) =>  L$ a c -> (c -> r) -> m r  uses :: ? a m =>  b  : a c -> (c -> e) -> m e  uses :: ? a m =>  b  h a c -> (c -> e) -> m e  uses :: (? a m, Monoid r) =>  b . a c -> (c -> r) -> m r Query the target of a  :,  h or  - in the current state, or use a summary of a   L or . that points  to a monoidal value.   query :: @ a m =>  a c -> m c  query :: (@ a m, Monoid c) =>  L a c -> m c  query :: @ a m =>  b  h a c -> m c  query :: @ a m =>  b  : a c -> m c  query :: (@ a m, Monoid c) =>  b . a c -> m c Use the target of a  :,  h or  - in the current state, or use a summary of a   L or . that points  to a monoidal value.   queries :: @ a m => " a c -> (c -> e) -> m e  queries :: (@ a m, Monoid c) =>  L$ a c -> (c -> e) -> m e  queries :: @ a m =>  b  h a c -> (c -> e) -> m e  queries :: @ a m =>  b  : a c -> (c -> e) -> m e  queries :: (@ a m, Monoid c) =>  b . a c -> (c -> e) -> m e   Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered" type  k f a b =  ( k f) a b type  f a b c d =  (->) f a b c dMany combinators that accept a  can also accept a  . in limited situations. 'They do so by specializing the type of  that they require of the  caller. If a function accepts a  f a b c d for some  f,  then they may be passed a .  Further, if f is an , they may also be passed a  .. type  f =  ( f) type  =  A  ,  . , ... can  be used instead of a ,., ...  whenever the type variables don't change upon setting a value.    j ::   (kl a) a  m ::  n. [a] a .Note: To use this alias in your own code with  f or  -, you may have to turn on LiberalTypeSynonyms. A + is actually a lens family as described in   /http://comonad.com/reader/2012/mirrored-lenses/. 2With great power comes great responsibility and a is subject to the  three common sense lens laws: !1) You get back what you put in:   o l (p l b a) = b"2) Putting back what you got doesn't change anything:  p l ( o l a) a = a.3) Setting twice is the same as setting once:  p l c (p l b a) = p l c a=These laws are strong enough that the 4 type parameters of a  cannot C vary fully independently. For more on how they interact, read the Why is it a Lens Family? section of   /http://comonad.com/reader/2012/mirrored-lenses/. Every  can be used directly as a Setter or  .. You can also use a  for  q as if it were a   L or  r. Since every lens is a valid ., the < traversal laws should also apply to any lenses you create.    l 6 = 6   (l f) . l g = st . l (su .  f . g)  type  a b c d = forall f.  f =>  f a b c dBuild a  from a getter and a setter. J lens :: Functor f => (a -> c) -> (a -> d -> b) -> (c -> f d) -> a -> f b (') can be used in one of two scenarios: When applied to a  , it can edit the target of the  in a , structure, extracting a functorial result. When applied to a ., it can edit the  targets of the  Traversals+, extracting an applicative summary of its  actions. 8For all that the definition of this combinator is just:  () = 4   (%%~) ::  f =>  h) a b c d -> (c -> f d) -> a -> f b  (%%~) ::  f => ( a b c d -> (c -> f d) -> a -> f b  (%%~) ::  f => .# a b c d -> (c -> f d) -> a -> f b DIt may be beneficial to think about it as if it had these even more  restrictive types, however: When applied to a ., it can edit the  targets of the  Traversals-, extracting a supplemental monoidal summary  of its actions, by choosing  f = ((,) m)   (%%~) ::  h/ a b c d -> (c -> (e, d)) -> a -> (e, b)  (%%~) :: . a b c d -> (c -> (e, d)) -> a -> (e, b)  (%%~) :: Monoid m => .) a b c d -> (c -> (m, d)) -> a -> (m, b) Modify the target of a + in the current state returning some extra  information of c or modify all targets of a  .( in the current state, extracting extra  information of type c/ and return a monoidal summary of the changes.  () = (A 3)It may be useful to think of ($), instead, as having either of the , following more restricted type signatures:   (%%=) :: ? a m =>  h& a a c d -> (c -> (e, d) -> m e  (%%=) :: ? a m => % a a c d -> (c -> (e, d) -> m e  (%%=) :: (? a m, Monoid e) => . a a c d -> (c -> (e, d) -> m e HThis lens can be used to change the result of a function but only where $ the arguments match the key given. 9Merge two lenses, getters, setters, folds or traversals.  makes a ) from two other lenses (or isomorphisms)  Cloning a ) is one way to make sure you arent given  something weaker, such as a . and can be D used as a way to pass around lenses that have to be monomorphic in f. !Note: This only accepts a proper . "/Costate Comonad Coalgebra is equivalent of Java's member variable  update technology for Haskell" -- @PLT_Borat on Twitter Modify the target of a  and return the result 2When you do not need the result of the addition, (v) is more flexible. -Increment the target of a numerically valued  and return the result 2When you do not need the result of the addition, (v) is more flexible. -Decrement the target of a numerically valued  and return the result 5When you do not need the result of the subtraction, (w) is more flexible. ,Multiply the target of a numerically valued  and return the result 8When you do not need the result of the multiplication, (x ) is more  flexible. +Divide the target of a fractionally valued  and return the result. 2When you do not need the result of the division, (y) is more flexible. )Raise the target of a numerically valued  to a non-negative  ; power and return the result 2When you do not need the result of the division, (z) is more flexible. *Raise the target of a fractionally valued  to an ; power  and return the result. 2When you do not need the result of the division, ({) is more flexible. ,Raise the target of a floating-point valued  to an arbitrary power  and return the result. 2When you do not need the result of the division, (|) is more flexible.  Logically = a Boolean valued  and return the result 3When you do not need the result of the operation, (}) is more flexible.  Logically > a Boolean valued  and return the result 3When you do not need the result of the operation, (~) is more flexible. Modify the target of a  into your monad's state by a user supplied ! function and return the result. 3When you do not need the result of the operation, () is more flexible. *Add to the target of a numerically valued  into your monad's state  and return the result. 8When you do not need the result of the multiplication, ( ) is more  flexible. 1Subtract from the target of a numerically valued  into your monad's  state and return the result. 8When you do not need the result of the multiplication, ( ) is more  flexible. ,Multiply the target of a numerically valued  into your monad's  state and return the result. 8When you do not need the result of the multiplication, ( ) is more  flexible. +Divide the target of a fractionally valued  into your monad's state  and return the result. 2When you do not need the result of the division, () is more flexible. )Raise the target of a numerically valued  into your monad's state  to a non-negative ; power and return the result. 3When you do not need the result of the operation, () is more flexible. *Raise the target of a fractionally valued  into your monad's state  to an ; power and return the result. 3When you do not need the result of the operation, () is more flexible. ,Raise the target of a floating-point valued  into your monad's 4 state to an arbitrary power and return the result. 3When you do not need the result of the operation, () is more flexible.  Logically = a Boolean valued  into your monad's state and return  the result. 3When you do not need the result of the operation, () is more flexible.  Logically > a Boolean valued  into your monad's state and return  the result. 3When you do not need the result of the operation, () is more flexible. """"  Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered2A I describes how to retrieve multiple values in a way that can be composed % with other lens-like constructions. A  a cC provides a structure with operations very similar to those of the B  typeclass, see  and the other  combinators. !By convention, if there exists a foo method that expects a B (f c), then there should be a  fooOf method that takes a  a c and a value of type a. A  is a legal  that just ignores the supplied +  Unlike a . a  is read-only. Since a  cannot be used to write back $ there are no lens laws that apply.  Obtain a 9 by lifting an operation that returns a foldable result. +This can be useful to lift operations from  Data.List and elsewhere into a .  Obtain a  from any B. %Fold by repeating the input forever. C =  !A fold that replicates its input n times. D n =  ( n)ITransform a fold into a fold that loops over its elements over and over. import Control.Lens+take 6 $ toListOf (cycled traverse) [1,2,3] [1,2,3,1,2,3]2Build a fold that unfolds its values from a seed.  =  . x ^.  f5 Return an infinite fold of repeated applications of f to x. ' toListOf (iterated f) a = iterate f a  Obtain a  by filtering a ,  h, ,  or .. .This allows you to traverse the elements of a . or  in the opposite order. Note:  should have no impact on a  Setter,  or  h. To change the direction of an  h, use from.  Obtain a ! by taking elements from another , ,  h,  or . while a predicate holds.  E p =  ( p ))toListOf (takingWhile (<=3) folded) [1..][1,2,3] Obtain a # by dropping elements from another , ,  h,  or . while a predicate holds.  F p =  ( p ),toListOf (droppingWhile (<=3) folded) [1..6][4,5,6]  =    =    foldMapOf :: % a c -> (c -> r) -> a -> r  foldMapOf :: + r => ' a c -> (c -> r) -> a -> r  foldMapOf ::   a c -> (c -> r) -> a -> r  foldMapOf ::   h! a c -> (c -> r) -> a -> r  foldMapOf :: + r =>  . a c -> (c -> r) -> a -> r   =    =    foldOf ::  a m -> a -> m  foldOf :: + m =>  a m -> a -> m  foldOf ::   a m -> a -> m  foldOf ::   h a m -> a -> m  foldOf :: + m =>  . a m -> a -> m IRight-associative fold of parts of a structure that are viewed through a , ,  or ..   =     foldrOf :: / a c -> (c -> e -> e) -> e -> a -> e  foldrOf :: 1 a c -> (c -> e -> e) -> e -> a -> e  foldrOf ::  * a c -> (c -> e -> e) -> e -> a -> e  foldrOf ::   h+ a c -> (c -> e -> e) -> e -> a -> e  foldrOf ::  .% a c -> (c -> e -> e) -> e -> a -> e LLeft-associative fold of the parts of a structure that are viewed through a , ,  or ..   =     foldlOf :: / a c -> (e -> c -> e) -> e -> a -> e  foldlOf :: 1 a c -> (e -> c -> e) -> e -> a -> e  foldlOf ::  * a c -> (e -> c -> e) -> e -> a -> e  foldlOf ::   h+ a c -> (e -> c -> e) -> e -> a -> e  foldlOf ::  .% a c -> (e -> c -> e) -> e -> a -> e   =     toListOf ::  a c -> a -> [c]  toListOf ::  a c -> a -> [c]  toListOf ::   a c -> a -> [c]  toListOf ::   h a c -> a -> [c]  toListOf ::  . a c -> a -> [c]   =     andOf ::  a - -> a -> -  andOf ::  a - -> a -> -  andOf ::   a - -> a -> -  andOf ::   h a - -> a -> -  andOf ::  . a - -> a -> -   =     orOf ::  a - -> a -> -  orOf ::  a - -> a -> -  orOf ::   a - -> a -> -  orOf ::   h a - -> a -> -  orOf ::  . a - -> a -> -   =     anyOf ::  a c -> (c -> - ) -> a -> -  anyOf ::  a c -> (c -> - ) -> a -> -  anyOf ::   a b c d -> (c -> - ) -> a -> -  anyOf ::   h a b c d -> (c -> - ) -> a -> -  anyOf ::  . a b c d -> (c -> - ) -> a -> -   =     allOf ::  a c -> (c -> - ) -> a -> -  allOf ::  a c -> (c -> - ) -> a -> -  allOf ::   a c -> (c -> - ) -> a -> -  allOf ::   h a c -> (c -> - ) -> a -> -  allOf ::  . a c -> (c -> - ) -> a -> -   =     productOf ::  a c -> a -> c  productOf :: 9 c =>  a c -> a -> c  productOf ::   a c -> a -> c  productOf ::   h a c -> a -> c  productOf :: 9 c =>  . a c -> a -> c   =    _1 :: (a, b) -> a  ( . _1) :: (B f, 9 a) => f (a, b) -> a   sumOf ::  a c -> a -> c  sumOf :: 9 c =>  a c -> a -> c  sumOf ::   a c -> a -> c  sumOf ::   h a c -> a -> c  sumOf :: 9 c =>  . a c -> a -> c When passed a ,  can work over a . When passed a ,  requires an .   =    _2 :: # f => (c -> f e) -> (c1, c) -> f ()   ::  f => (a -> f b) ->  a c -> f ()bThe rather specific signature of traverseOf_ allows it to be used as if the signature was either:   traverseOf_ ::  f => * a c -> (c -> f e) -> a -> f ()  traverseOf_ ::  f => , a c -> (c -> f e) -> a -> f ()  traverseOf_ ::  f =>  % a c -> (c -> f e) -> a -> f ()  traverseOf_ ::  f =>   h& a c -> (c -> f e) -> a -> f ()  traverseOf_ ::  f =>  . a c -> (c -> f e) -> a -> f ()  G =     forOf_ ::  f => * a c -> a -> (c -> f e) -> f ()  forOf_ ::  f => , a c -> a -> (c -> f e) -> f ()  forOf_ ::  f =>  % a c -> a -> (c -> f e) -> f ()  forOf_ ::  f =>   h& a c -> a -> (c -> f e) -> f ()  forOf_ ::  f =>  . a c -> a -> (c -> f e) -> f ()  H =     sequenceAOf_ ::  f => ! a (f ()) -> a -> f ()  sequenceAOf_ ::  f => # a (f ()) -> a -> f ()  sequenceAOf_ ::  f =>   a (f ()) -> a -> f ()  sequenceAOf_ ::  f =>  Iso a (f ()) -> a -> f ()  sequenceAOf_ ::  f =>  . a (f ()) -> a -> f ()  2 =     mapMOf_ :: / m => * a c -> (c -> m e) -> a -> m ()  mapMOf_ :: / m => , a c -> (c -> m e) -> a -> m ()  mapMOf_ :: / m =>  % a c -> (c -> m e) -> a -> m ()  mapMOf_ :: / m =>   h& a c -> (c -> m e) -> a -> m ()  mapMOf_ :: / m =>  . a c -> (c -> m e) -> a -> m ()   =     forMOf_ :: / m => * a c -> a -> (c -> m e) -> m ()  forMOf_ :: / m => , a c -> a -> (c -> m e) -> m ()  forMOf_ :: / m =>  % a c -> a -> (c -> m e) -> m ()  forMOf_ :: / m =>   h& a c -> a -> (c -> m e) -> m ()  forMOf_ :: / m =>  . a c -> a -> (c -> m e) -> m ()   =     sequenceOf_ :: / m =>  a (m b) -> a -> m ()  sequenceOf_ :: / m => " a (m b) -> a -> m ()  sequenceOf_ :: / m =>   a (m b) -> a -> m ()  sequenceOf_ :: / m =>   h a (m b) -> a -> m ()  sequenceOf_ :: / m =>  . a (m b) -> a -> m () 1The sum of a collection of actions, generalizing .  I =     asumOf :: J f =>  a c -> a -> f c  asumOf :: J f =>  a c -> a -> f c  asumOf :: J f =>   a c -> a -> f c  asumOf :: J f =>   h a c -> a -> f c  asumOf :: J f =>  . a c -> a -> f c 1The sum of a collection of actions, generalizing .  K =     msumOf :: L m =>  a c -> a -> m c  msumOf :: L m =>  a c -> a -> m c  msumOf :: L m =>   a c -> a -> m c  msumOf :: L m =>   h a c -> a -> m c  msumOf :: L m =>  . a c -> a -> m c  M =     elemOf :: N c =>  a c -> c -> a -> -  elemOf :: N c =>  a c -> c -> a -> -  elemOf :: N c =>   a c -> c -> a -> -  elemOf :: N c =>   h a c -> c -> a -> -  elemOf :: N c =>  . a c -> c -> a -> -  O =     notElemOf :: N c =>  a c -> c -> a -> -  notElemOf :: N c =>  a c -> c -> a -> -  notElemOf :: N c =>   h a c -> c -> a -> -  notElemOf :: N c =>   a c -> c -> a -> -  notElemOf :: N c =>  . a c -> c -> a -> -  P =     concatMapOf ::  a c -> (c -> [e] ) -> a -> [e]  concatMapOf ::  a c -> (c -> [e] ) -> a -> [e]  concatMapOf ::   a c -> (c -> [e] ) -> a -> [e]  concatMapOf ::   h a c -> (c -> [e] ) -> a -> [e]  concatMapOf ::  . a c -> (c -> [e] ) -> a -> [e]    Q =     =     concatOf ::  a [e] -> a -> [e]  concatOf ::  a [e] -> a -> [e]  concatOf ::   h a [e] -> a -> [e]  concatOf ::   a [e] -> a -> [e]  concatOf ::  . a [e] -> a -> [e] ;Note: this can be rather inefficient for large containers.  R =  import Control.LenslengthOf _1 ("hello",())1  ( . ) :: B f => f (g a) ->    lengthOf ::  a c -> a ->   lengthOf ::  a c -> a ->   lengthOf ::   a c -> a ->   lengthOf ::   h a c -> a ->   lengthOf ::  . a c -> a ->  Perform a safe S of a  or . or retrieve T the result  from a  or .  U . V =     headOf ::  a c -> a ->  c  headOf ::  a c -> a ->  c  headOf ::   a c -> a ->  c  headOf ::   h a c -> a ->  c  headOf ::  . a c -> a ->  c Perform a safe W of a  or . or retrieve T the result  from a  or .   lastOf ::  a c -> a ->  c  lastOf ::  a c -> a ->  c  lastOf ::   a c -> a ->  c  lastOf ::   h a c -> a ->  c  lastOf ::  . a c -> a ->  c Returns X if this  or .( has no targets in the given container. Note:  on a valid  h,  or  should always return Y  Z =  /This may be rather inefficient compared to the Z check of many containers. import Control.LensnullOf _1 (1,2)False  ( . _1 . ) :: B f => f (g a, b) -> -   nullOf ::  a c -> a -> -  nullOf ::  a c -> a -> -  nullOf ::   h a c -> a -> -  nullOf ::   a c -> a -> -  nullOf ::  . a c -> a -> - 2Obtain the maximum element (if any) targeted by a  or . Note: maximumOf on a valid  h,  or  will always return T a value.  [ = \ (] empty) .     maximumOf ::  a c -> a ->  c  maximumOf :: ^ c =>  a c -> a ->  c  maximumOf ::   h a c -> a ->  c  maximumOf ::   a c -> a ->  c  maximumOf :: ^ c =>  . a c -> a ->  c 2Obtain the minimum element (if any) targeted by a  or . Note: minimumOf on a valid  h,  or  will always return T a value.  _ = \ (] empty) .     minimumOf ::  a c -> a ->  c  minimumOf :: ^ c =>  a c -> a ->  c  minimumOf ::   h a c -> a ->  c  minimumOf ::   a c -> a ->  c  minimumOf :: ^ c =>  . a c -> a ->  c 2Obtain the maximum element (if any) targeted by a , ., ,  h,  or ( according to a user supplied ordering.   cmp = \ (] empty) .   cmp   maximumByOf ::  a c -> (c -> c -> ` ) -> a ->  c  maximumByOf ::  a c -> (c -> c -> ` ) -> a ->  c  maximumByOf ::   h a c -> (c -> c -> ` ) -> a ->  c  maximumByOf ::   a c -> (c -> c -> ` ) -> a ->  c  maximumByOf ::  . a c -> (c -> c -> ` ) -> a ->  c 2Obtain the minimum element (if any) targeted by a , ., ,  h  or ( according to a user supplied ordering.  D minimumBy cmp = fromMaybe (error "empty") . minimumByOf folded cmp   minimumByOf ::  a c -> (c -> c -> ` ) -> a ->  c  minimumByOf ::  a c -> (c -> c -> ` ) -> a ->  c  minimumByOf ::   h a c -> (c -> c -> ` ) -> a ->  c  minimumByOf ::   a c -> (c -> c -> ` ) -> a ->  c  minimumByOf ::  . a c -> (c -> c -> ` ) -> a ->  c The  function takes a  (or ,  h, , or .), O a predicate and a structure and returns the leftmost element of the structure  matching the predicate, or 0 if there is no such element.   findOf ::  a c -> (c -> - ) -> a ->  c  findOf ::  a c -> (c -> - ) -> a ->  c  findOf ::   h a c -> (c -> - ) -> a ->  c  findOf ::   a c -> (c -> - ) -> a ->  c  findOf ::  . a c -> (c -> - ) -> a ->  c  A variant of 4 that has no base case and thus may only be applied K to lenses and structures such that the lens views at least one element of  the structure.   l f = a f .  l  =     foldr1Of :: * a c -> (c -> c -> c) -> a -> c  foldr1Of :: , a c -> (c -> c -> c) -> a -> c  foldr1Of ::   h& a c -> (c -> c -> c) -> a -> c  foldr1Of ::  % a c -> (c -> c -> c) -> a -> c  foldr1Of ::  . a c -> (c -> c -> c) -> a -> c  A variant of Q that has no base case and thus may only be applied to lenses and strutures such < that the lens views at least one element of the structure.   l f =  l f . V  =     foldl1Of :: * a c -> (c -> c -> c) -> a -> c  foldl1Of :: , a c -> (c -> c -> c) -> a -> c  foldl1Of ::   h& a c -> (c -> c -> c) -> a -> c  foldl1Of ::  % a c -> (c -> c -> c) -> a -> c  foldl1Of ::  . a c -> (c -> c -> c) -> a -> c 6Strictly fold right over the elements of a structure.   =     foldrOf' :: / a c -> (c -> e -> e) -> e -> a -> e  foldrOf' :: 1 a c -> (c -> e -> e) -> e -> a -> e  foldrOf' ::   h+ a c -> (c -> e -> e) -> e -> a -> e  foldrOf' ::  * a c -> (c -> e -> e) -> e -> a -> e  foldrOf' ::  .% a c -> (c -> e -> e) -> e -> a -> e NFold over the elements of a structure, associating to the left, but strictly.   =     foldlOf' :: / a c -> (e -> c -> e) -> e -> a -> e  foldlOf' :: 1 a c -> (e -> c -> e) -> e -> a -> e  foldlOf' ::   h+ a c -> (e -> c -> e) -> e -> a -> e  foldlOf' ::  * a c -> (e -> c -> e) -> e -> a -> e  foldlOf' ::  .% a c -> (e -> c -> e) -> e -> a -> e IMonadic fold over the elements of a structure, associating to the right,  i.e. from right to left.   =     foldrMOf :: / m => 3 a c -> (c -> e -> m e) -> e -> a -> m e  foldrMOf :: / m => 5 a c -> (c -> e -> m e) -> e -> a -> m e  foldrMOf :: / m =>   h/ a c -> (c -> e -> m e) -> e -> a -> m e  foldrMOf :: / m =>  . a c -> (c -> e -> m e) -> e -> a -> m e  foldrMOf :: / m =>  .) a c -> (c -> e -> m e) -> e -> a -> m e HMonadic fold over the elements of a structure, associating to the left,  i.e. from left to right.   =     foldlMOf :: / m => 3 a c -> (e -> c -> m e) -> e -> a -> m e  foldlMOf :: / m => 5 a c -> (e -> c -> m e) -> e -> a -> m e  foldlMOf :: / m =>   h/ a c -> (e -> c -> m e) -> e -> a -> m e  foldlMOf :: / m =>  . a c -> (e -> c -> m e) -> e -> a -> m e  foldlMOf :: / m =>  .) a c -> (e -> c -> m e) -> e -> a -> m e 3b223b Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered type SimpleTraversal =  A  can be used directly as a - or a  (but not as a ) and provides V the ability to both read and update multiple fields, subject to some relatively weak  laws. UThese have also been known as multilenses, but they have the signature and spirit of   ::  f =>  (f a) (f b) a b8and the more evocative name suggests their application. Most of the time the  you will want to use is just , but you can also pass any   or  h as a , and composition of a  (or  or  h ) with a  (or  or  h)  using (.) forms a valid . The laws for a Traversal t3 follow from the laws for Traversable as stated in "#The Essence of the Iterator Pattern".    t 6 = 6   (t f) . t g = st . t (su .  f . g) .One consequence of this requirement is that a 1 needs to leave the same number of elements as a  candidate for subsequent G that it started with. Another testament to the strength of these laws 4 is that the caveat expressed in section 5.5 of the "Essence of the Iterator Pattern" about exotic   instances that E the same entry multiple times was actually already ruled out by the  second law in that same paper! AMap each element of a structure targeted by a Lens or Traversal, E evaluate these actions from left to right, and collect the results.   = 4  =      ::  h) a b c d -> (c -> f d) -> a -> f b   :: ( a b c d -> (c -> f d) -> a -> f b   :: # a b c d -> (c -> f d) -> a -> f b   l = . ( l)   c =     = .    forOf ::  h# a b c d -> a -> (c -> f d) -> f b  forOf :: # a b c d -> a -> (c -> f d) -> f b  forOf :: # a b c d -> a -> (c -> f d) -> f b FEvaluate each action in the structure from left to right, and collect  the results.    d =   =  4   l =  l id   l = l id     ::  h a b (f c) c -> a -> f b   ::  a b (f c) c -> a -> f b   ::  f =>  a b (f c) c -> a -> f b HMap each element of a structure targeted by a lens to a monadic action, E evaluate these actions from left to right, and collect the results.  e =     'mapMOf ::  h) a b c d -> (c -> m d) -> a -> m b  'mapMOf :: ( a b c d -> (c -> m d) -> a -> m b  ' mapMOf :: / m => # a b c d -> (c -> m d) -> a -> m b    f =     l = . ( l)    forMOf ::  h) a b c d -> a -> (c -> m d) -> m b  forMOf :: ( a b c d -> a -> (c -> m d) -> m b  forMOf :: / m => # a b c d -> a -> (c -> m d) -> m b    g =    sequenceOf l =  l id  sequenceOf l = h . l i    sequenceOf ::  h a b (m c) c -> a -> m b  sequenceOf ::  a b (m c) c -> a -> m b  sequenceOf :: / m =>  a b (m c) c -> a -> m b This generalizes  to an arbitrary . Note: F handles ragged inputs more intelligently, but for non-ragged inputs:   =  &transposeOf traverse [[1,2,3],[4,5,6]][[1,4],[2,5],[3,6]] Since every  is a , we can use this as a form of  monadic strength as well:  _2 :: (b, [a] ) -> [(b, a)] Generalizes j to an arbitrary .  j =  ' accumulates state from right to left.   mapAccumROf ::  h9 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b)  mapAccumROf :: 8 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b)  mapAccumROf :: 3 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b)  Generalized k to an arbitrary .  k =  ' accumulates state from left to right.   mapAccumLOf ::  h9 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b)  mapAccumLOf :: 8 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b)  mapAccumLOf :: 3 a b c d -> (s -> c -> (s, d)) -> s -> a -> (s, b) Permit the use of l over an arbitrary  or .  l =     scanr1Of ::  h* a b c c -> (c -> c -> c) -> a -> b  scanr1Of :: ) a b c c -> (c -> c -> c) -> a -> b  scanr1Of :: $ a b c c -> (c -> c -> c) -> a -> b Permit the use of m over an arbitrary  or .  m =    : scanr1Of :: Iso a b c c -> (c -> c -> c) -> a -> b : scanr1Of :: Lens a b c c -> (c -> c -> c) -> a -> b : scanr1Of :: Traversal a b c c -> (c -> c -> c) -> a -> b  A  to 4'Control.Lens.Getter.view'/'Control.Lens.Setter.set' the nth element   a ,  or  h. +Attempts to access beyond the range of the  will cause an error. import Control.Lens,[[1],[3,4]]^.elementOf (traverse.traverse) 13 Access the nth element of a  container. +Attempts to access beyond the range of the  will cause an error.   =    %This is the traversal that just doesn't return anything   ::  f => (c -> f d) -> a -> f a GA traversal is completely characterized by its behavior on the indexed   store comonad.  Cloning a ) is one way to make sure you arent given  something weaker, such as a L and can be H used as a way to pass around traversals that have to be monomorphic in f. !Note: This only accepts a proper  (or ).  To clone a  as such, use                   Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered  type SimpleIso =  DIsomorphim families can be composed with other lenses using either () and  I from the Prelude or from Control.Category. However, if you compose them  with each other using (2) from the Prelude, they will be dumbed down to a  mere .   import Control.Category  import Prelude hiding ((.),id)  type Iso a b c d = forall k f. ( k,  f) =>  k f a b c d@Build an isomorphism family from two pairs of inverse functions     ( ac ca bd db) = ac   ( ( ac ca bd db)) = ca   ( ac ca bd db) cd = db . cd . ac   ( ( ac ca bd db')) ab = bd . ab . ca  8isos :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) ->  a b c d<Build a simple isomorphism from a pair of inverse functions     ( f g) = f   ( ( f g)) = g   ( f g) h = g . h . f   ( ( f g')) h = f . h . g  iso :: (a -> b) -> (b -> a) ->   a b Based on ala from Conor McBride's work on Epigram. Mnemonically, au is a French contraction of  le. 0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _sum foldMap [1,2,3,4]10 Based on ala' from Conor McBride's work on Epigram. Mnemonically, the German auf plays a similar role to  la, and the combinator  is au" with an extra function argument. The opposite of working  a Setter is working  an Isomorphism.   =  .  ' :: Iso a b c d -> (a -> b) -> (c -> d):This isomorphism can be used to wrap or unwrap a value in .   x^.identity =  x   x    = x :This isomorphism can be used to wrap or unwrap a value in    x   =  x   x    = x       "rank 2 types, MPTCs, TFs, flexible provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered type  i =  ( i)Every  is a valid  and a valid M. Adjust the target of an ' returning the intermediate result, or ! adjust all of the targets of an M and return a monoidal summary  along with the answer.  l  f = l  , f/When you do not need access to the index then ()) is more liberal in what it can accept. 9If you do not need the intermediate result, you can use (  ) or even ( ).   (<%@~) :: + i a b c d -> (i -> c -> d) -> a -> (d, b)  (<%@~) :: Monoid d => M+ i a b c d -> (i -> c -> d) -> a -> (d, b) Adjust the target of an & returning a supplementary result, or ! adjust all of the targets of an M and return a monoidal summary . of the supplementary results and the answer.  () = T   (%%@~) ::  f => / i a b c d -> (i -> c -> f d) -> a -> f b  (%%@~) ::  f => M* i a b c d -> (i -> c -> f d) -> a -> f b ^In particular, it is often useful to think of this function as having one of these even more  restrictive type signatures   (%%@~) :: 5 i a b c d -> (i -> c -> (e, d)) -> a -> (e, b)  (%%@~) :: Monoid e => M0 i a b c d -> (i -> c -> (e, d)) -> a -> (e, b) Adjust the target of an & returning a supplementary result, or ! adjust all of the targets of an M within the current state, and 9 return a monoidal summary of the supplementary results.  l  f = A (l  f)   (%%@=) :: ? a m 2 i a a c d -> (i -> c -> (e, d)) -> a -> m e  (%%@=) :: (? a m, Monoid e) => M- i a a c d -> (i -> c -> (e, d)) -> a -> m e Adjust the target of an ' returning the intermediate result, or ! adjust all of the targets of an M within the current state, and 8 return a monoidal summary of the intermediate results.   (<%@=) :: ? a m - i a a c d -> (i -> c -> d) -> a -> m d  (<%@=) :: (? a m, Monoid e) => M( i a a c d -> (i -> c -> d) -> a -> m d "rank 2 types, MPTCs, TFs, flexible provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered type  i =  ( i)#Every indexed traversal is a valid . or K. The V constraint is used to allow an  to be used directly as a .. The ." laws are still required to hold. Traversal with an index. NB: When you don'8t need access to the index then you can just apply your   directly as a function!     = T   =  . , = 4    itraverseOf ::  _/ i a b c d -> (i -> c -> f d) -> a -> f b  itraverseOf :: * i a b c d -> (i -> c -> f d) -> a -> f b 3Traverse with an index (and the arguments flipped)   l a =  l a . ,  = . .    iforOf ::  _/ i a b c d -> a -> (i -> c -> f d) -> f b  iforOf :: * i a b c d -> a -> (i -> c -> f d) -> f b  HMap each element of a structure targeted by a lens to a monadic action, Q evaluate these actions from left to right, and collect the results, with access  its position.  When you don't need access to the index mapMOf( is more liberal in what it can accept.   =   . ,   imapMOf :: / m =>  _/ i a b c d -> (i -> c -> m d) -> a -> m b  imapMOf :: / m => * i a b c d -> (i -> c -> m d) -> a -> m b !HMap each element of a structure targeted by a lens to a monadic action, Q evaluate these actions from left to right, and collect the results, with access + its position (and the arguments flipped).     l a = ! l a . ,  ! = . .      iforMOf :: / m =>  _/ i a b c d -> a -> (i -> c -> m d) -> m b  iforMOf :: / m => * i a b c d -> a -> (i -> c -> m d) -> m b " Generalizes e to an arbitrary  with access to the index. "' accumulates state from right to left.   l = " l . ,   imapAccumROf ::  _? i a b c d -> (i -> s -> c -> (s, d)) -> s -> a -> (s, b)  imapAccumROf :: : i a b c d -> (i -> s -> c -> (s, d)) -> s -> a -> (s, b) # Generalizes e to an arbitrary  with access to the index. #' accumulates state from left to right.   l = # l . ,   imapAccumLOf ::  _? i a b c d -> (i -> s -> c -> (s, d)) -> s -> a -> (s, b)  imapAccumLOf :: : i a b c d -> (i -> s -> c -> (s, d)) -> s -> a -> (s, b)  !"# !"# !"# !"# Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered$This LensK can be used to read, write or delete the value associated with a key in a n. :m + Control.Lens Data.Map.Lens(Map.fromList [("hello",12)] ^.at "hello"Just 12!at 10 .~ Just "hello" $ Map.emptyfromList [(10,"hello")] H at :: Ord k => k -> (Maybe v -> f (Maybe v)) -> Map k v -> f (Map k v) %Traversal of a n indexed by the key. &+Traverse the value at a given key in a Map S traverseAt :: (Applicative f, Ord k) => k -> (v -> f v) -> Map k v -> f (Map k v) % traverseAt k = valueAt k . traverse '0Traverse the value at the minimum key in a Map. KThe key of the minimum element is available as the index of the traversal. (0Traverse the value at the maximum key in a Map. KThe key of the maximum element is available as the index of the traversal. $%&'($%&'($%&'($%&'("rank 2 types, MPTCs, TFs, flexible provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered) type ) i =  (* i)*Every * is a valid Setter The Setter" laws are still required to hold. +Map with index. /When you do not need access to the index, then mapOf( is more liberal in what it can accept.  mapOf l = + l . ,   imapOf :: *) i a b c d -> (i -> c -> d) -> a -> b  imapOf ::  _+ i a b c d -> (i -> c -> d) -> a -> b  imapOf :: M& i a b c d -> (i -> c -> d) -> a -> b ,Adjust every target of an *,  _ or M  with access to the index.  (,) = +/When you do not need access to the index then (,)) is more liberal in what it can accept.  l %~ f = l , , f   (%@~) :: *) i a b c d -> (i -> c -> d) -> a -> b  (%@~) ::  _+ i a b c d -> (i -> c -> d) -> a -> b  (%@~) :: M& i a b c d -> (i -> c -> d) -> a -> b -/Adjust every target in the current state of an *,  _ or M  with access to the index. /When you do not need access to the index then (%=)) is more liberal in what it can accept.  l %= f = l - , f   (%@=) :: ? a m => *' i a a c d -> (i -> c -> d) -> m ()  (%@=) :: ? a m =>  _) i a a c d -> (i -> c -> d) -> m ()  (%@=) :: ? a m => M$ i a b c d -> (i -> c -> d) -> m () )*+,-)*+,-*+,-))*+,- RankNTypes provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered.GSometimes you need to store a path lens into a container, but at least  at this time, ImpredicativePolymorphism in GHC is somewhat lacking. *This type provides a way to, say, store a [] of polymorphic lenses. 1Representable Functors. A  f is 1 if it is isomorphic to (x -> a) E for some x. Nearly all such functors can be represented by choosing x to be ? the set of lenses that are polymorphic in the contents of the ,  that is to say x = 3 f is a valid choice of x for (nearly) every  1 . @Note: Some sources refer to covariant representable functors as ) corepresentable functors, and leave the " representable" name to 1 contravariant functors (those are isomorphic to (a -> x) for some x). LAs the covariant case is vastly more common, and both are often referred to = as representable functors, we choose to call these functors 1  here. 3The representation of a 1  as Lenses 44# is a valid default definition for  for a 1  functor.  4 f m = 2 8 i -> f (m  i) Usage for a 1 Foo:   instance  Foo where   = 4 55# is a valid default definition for 6 and o for a  1 functor.  5 = 2 . , Usage for a 1 Foo:    instance  Foo where  6 = 5  ...    instance / Foo where  o = 5  ... 66$ is a valid default definition for (p) for a 1  functor.  6 mf ma = 2 8 i -> mf  i 8 ma  i Usage for a 1 Foo:   instance  Foo where  6 = 5  (p) = 6 77+ is a valid default default definition for '(>>=)' for a  representable functor.  7 m f = 2 8 i -> f (m  i)  i Usage for a 1 Foo:   instance / Foo where  o = 5  (q) = 7 8A default definition for  for a 1   8 wf = 2 8 i ->  ( i) wf Usage for a 1 Foo:   instance  Foo where   = 8 9A 1 - has a fixed shape. This fills each position  in it with a . : A version of 25 that is an isomorphism. Predicativity requires that  we wrap the 3 as a Key , however. ; Map over a 1 functor with access to the  for the  current position ; f m = 2 8 i -> f i (m  i)< Traverse a 1) functor with access to the current path = Traverse a 1) functor with access to the current path  as a , discarding the result > Traverse a 1) functor with access to the current path  and a  (and the arguments flipped) ?e over a 1) functor with access to the current path  as a  @e over a 1) functor with access to the current path  as a , discarding the result Ae over a 1) functor with access to the current path  as a  (with the arguments flipped) B Fold over a 1) functor with access to the current path  as a  , yielding a + C Fold over a 1) functor with access to the current path  as a . rNB: The N@ requirement on this instance is a consequence of the choice of  as a 3, it isn't fundamental. ./0123456789:;<=>?@ABCrs./0123456789:;<=>?@ABC12345678./09:;BC<=>?@A./0123456789:;<=>?@ABCrs Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedD,Provides access to the 9th field of a tuple E Access the 9th field of a tuple F+Provide access to the 8th field of a tuple G Access the 8th field of a tuple H+Provide access to the 7th field of a tuple I Access the 7th field of a tuple J.Provides access to the 6th element of a tuple K Access the 6th field of a tuple L,Provides access to the 5th field of a tuple M Access the 5th field of a tuple N+Provide access to the 4th field of a tuple O Access the 4th field of a tuple P,Provides access to the 3rd field of a tuple Q Access the 3rd field of a tuple R,Provides access to the 2nd field of a tuple S Access the 2nd field of a tuple import Control.Lens_2 .~ "hello" $ (1,(),3,4)(1,"hello",3,4)    S S :: (c -> -) -> (a, c) -> -  eg 3 S :: ( Applicative f, e. t) => (a -> f b) -> t (c, a) -> f (t (c, b))   N (eg 3 S) :: (e t, ! m) => (c -> m) -> t (b, c) -> m T)Provides access to 1st field of a tuple. U@Access the 1st field of a tuple (and possibly change its type). import Control.Lens (1,2)^._11_1 .~ "hello" $ (1,2) ("hello",2)/This can also be used on larger tuples as well _1 +~ 41 $ (1,2,3,4,5) (42,2,3,4,5)   _1 ::  (a,b) (a',b) a a'  _1 ::  (a,b,c) (a' ,b,c) a a'  _1 ::  (a,b,c,d) (a' ,b,c,d) a a'  ...  _1 ::  (a,c,d,e,f,g,h,i) (a',b,c,d,e,f,g,h,i) a a' >DEFGHIJKLMNOPQRSTUtuvwxyz{|}~DEFGHIJKLMNOPQRSTUTURSPQNOLMJKHIFGDE5DEFGHIJKLMNOPQRSTUtuvwxyz{|}~ Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedVThis class allows us to use W? part of the environment, changing the environment supplied by + many different monad transformers. Unlike focusG this can change the environment of a deeply nested monad transformer.  Also, unlike focus", this can be used with any valid , but cannot be used with a  Traversal or Fold. WMRun a monadic action in a larger environment than it was defined in, using a . This acts like D, but can in many cases change the type of the environment as well. mThis is commonly used to lift actions in a simpler Reader monad into a monad with a larger environment type. \This can be used to edit pretty much any monad transformer stack with an environment in it:   magnify ::  a b -> (b -> c) -> a -> c  magnify :: + c => Fold a b -> (b -> c) -> a -> c  magnify :: + w  a b ->  a w s c ->  b w s c  magnify :: (+ w, + c) => Fold a b ->  a w s c ->  b w s c  ... XThis class allows us to use Y$ in, changing the State supplied by Y many different monad transformers, potentially quite deep in a monad transformer stack. Y?Run a monadic action in a larger state than it was defined in,  using a   or  .. FThis 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 . over H multiple values, the actions for each target are executed sequentially ! and the results are aggregated. UThis can be used to edit pretty much any monad transformer stack with a state in it!   zoom :: / m =>   a b ->  b m c ->  a m c  zoom :: (/ m, + c) =>  . a b ->  b m c ->  a m c  zoom :: / m =>   a b ->  r w b m c ->  r w a m c  zoom :: (/ m, + c) =>  . a b ->  r w b m c ->  r w a m c  zoom :: / m =>   a b ->  e ( r w b m c) ->  e ( r w a m c)  zoom :: (/ m, + c) =>  . a b ->  e ( r w b m c) ->  e ( r w a m c)  ...  W = VWXYVWXYVWXYVWXYportable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedZThis 4 can be used to read, write or delete a member of a  :m + Data.Set.Lens Control.Lens,contains 3 .~ False $ Set.fromList [1,2,3,4]fromList [1,2,4] B contains :: Ord k => k -> (Bool -> f Bool) -> Set k -> f (Set k) [This ~% can be used to change the type of a  by mapping  the elements to new values. Sadly, you can't create a valid  Traversal for a , but you can  manipulate it by reading using folded and reindexing it via setmap. :m + Data.Set.Lens Control.Lens(over setmapped (+1) (fromList [1,2,3,4])fromList [2,3,4,5]\Construct a set from a , Fold,  Traversal,  or Iso. :m + Data.Set.Lens Control.Lens5setOf (folded._2) [("hello",1),("world",2),("!!!",3)]fromList [1,2,3]   setOf ::  a c -> a ->  c  setOf :: ^ c => Fold a c -> a ->  c  setOf ::  Iso a c -> a ->  c  setOf ::   a c -> a ->  c  setOf :: ^ c =>   Traversal a c -> a ->  c Z[\Z[\Z[\Z[\TemplateHaskell experimentalEdward Kmett <ekmett@gmail.com> Trustworthy ] Provides substitution for types ^Perform substitution for types _HProvides for the extraction of free type variables, and alpha renaming. `4When performing substitution into this traversal you're not allowed 8 to substitute in a name that is bound internally or you' ll violate  the . laws, when in doubt generate your names with . aHas a  bExtract (or modify) the  of something c Traverse free type variables d'Substitute using a map of names in for free type variables e Provides a . of the types of each field of a constructor. ]^_`abcde ]^_`abcde ab_`]^cde]^_`abcdeTemplateHaskell experimentalEdward Kmett <ekmett@gmail.com> Trustworthyf+This configuration describes the options we'+ll be using to make isomorphisms or lenses hFlags for lens construction qOnly Generate valid   lenses r(Handle singleton constructors specially s#Use Iso for singleton constructors t@Expect a single constructor, single field newtype or data type. u6Create the class if the constructor is simple and the z rule matches v9Create the instance if the constructor is simple and the z rule matches w Die if the z fails to match xRLens to access the convention for naming top level isomorphisms in our lens rules =Defaults to lowercasing the first letter of the constructor. yBLens to access the convention for naming fields in our lens rules ODefaults to stripping the _ off of the field name and lowercasing the name and  rejecting the field if it doesn't start with an '_'. zwRetrieve options such as the name of the class and method to put in it to build a class around monomorphic data types. {wRetrieve options such as the name of the class and method to put in it to build a class around monomorphic data types. |Default lens rules })Build lenses with a custom configuration ~3Build lenses with a sensible default configuration ' makeLenses = makeLensesWith lensRules 7Make a top level isomorphism injecting _into_ the type dThe supplied name is required to be for a type with a single constructor that has a single argument # makeIso = makeLensesWith isoRules 1Rules for making an isomorphism from a data type Make ' classy lenses' for a type ) makeClassy = makeLensesWith classyRules 6Rules for making lenses that precompose another lens. /Derive lenses, specifying explicit pairings of (fieldName, lensName). Example usage: < makeLensesFor [("_foo", "fooLens"), ("bar", "lbar")] ''Foo pRules for making fairly simple lenses, ignoring the special cases for isomorphisms, and not making any classes. /Derive lenses, specifying explicit pairings of (fieldName, lensName)  using a wrapper class. Example usage: K makeClassyFor "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo fghijklmnopqrstuvwxyz{|}~ fghijklmnopqrstuvwxyz{|}~ fgxyz{hponmlkjiqrstuvw~}|fghponmlkjiqrstuvwxyz{|}~ Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered,RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYfghijklmnopqrstuvwxyz{|}~Control.Exception provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedTraverse the strongly typed  contained in ) where the type of your function matches  the desired .   traverseException :: ( f,  a,  b) $ => (a -> f b) ->  -> f  LiberalTypeSynonyms experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered Bitwise  the target(s) of a  or ~ _2 |~ 6 $ ("hello",3) ("hello",7)   (|~) ::  c => ~ a b c c -> c -> a -> b  (|~) ::  c =>  a b c c -> c -> a -> b  (|~) ::  c =>  a b c c -> c -> a -> b  (|~) :: ('Monoid c',  c) =>  a b c c -> c -> a -> b Bitwise  the target(s) of a  or ~ _2 &~ 7 $ ("hello",254) ("hello",6)   (&~) ::  c => ~ a b c c -> c -> a -> b  (&~) ::  c =>  a b c c -> c -> a -> b  (&~) ::  c =>  a b c c -> c -> a -> b  (&~) :: ('Monoid c',  c) =>  a b c c -> c -> a -> b Modify the target(s) of a  , ~ or  by computing its bitwise  with another value.   (&=):: (? a m,  b) =>  ~ a b -> b -> m ()  (&=):: (? a m,  b) =>   a b -> b -> m ()  (&=):: (? a m,  b) =>   a b -> b -> m ()  (&=):: (? a m,  b) =>   a b -> b -> m () Modify the target(s) of a  , ~ or  by computing its bitwise  with another value.   (|=):: (? a m,  b) =>  ~ a b -> b -> m ()  (|=):: (? a m,  b) =>   a b -> b -> m ()  (|=):: (? a m,  b) =>   a b -> b -> m ()  (|=):: (? a m,  b) =>   a b -> b -> m () Bitwise  the target(s) of a  (or ), returning the result 0 (or a monoidal summary of all of the results). _2 <|~ 6 $ ("hello",3)(7,("hello",7))   (<|~) ::  c =>  a b c c -> c -> a -> (c, b)  (<|~) ::  c =>  a b c c -> c -> a -> (c, b)  (<|~) :: ( c, ' Monoid c) =>  a b c c -> c -> a -> (c, b) Bitwise  the target(s) of a  or , returning the result 0 (or a monoidal summary of all of the results). _2 <&~ 7 $ ("hello",254)(6,("hello",6))   (<&~) ::  c =>  a b c c -> c -> a -> (c, b)  (<&~) ::  c =>  a b c c -> c -> a -> (c, b)  (<&~) :: ( c, ' Monoid c) =>  a b c c -> c -> a -> (c, b) Modify the target(s) of a   (or ) by computing its bitwise  with another value, N returning the result (or a monoidal summary of all of the results traversed)   (<&=) :: (? a m,  b) =>   a b -> b -> m b  (<&=) :: (? a m,  b, Monoid b) =>   a b -> b -> m b Modify the target(s) of a  , (or ) by computing its bitwise  with another value, N returning the result (or a monoidal summary of all of the results traversed)   (<|=) :: (? a m,  b) =>   a b -> b -> m b  (<|=) :: (? a m,  b, Monoid b) =>   a b -> b -> m b FThis lens can be used to access the value of the nth bit in a number.  n is only a legal  into b if 0 <= n <  ( :: b)  16^.bitAt 4True 15^.bitAt 4False*Traverse over all bits in a numeric type. ,The bit position is available as the index. import Data.Word"toListOf traverseBits (5 :: Word8)/[True,False,True,False,False,False,False,False]If you supply this an , the result will  be an infinite $ that can be productively consumed.     Rank2Types experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered Access the  of a  number ? real :: Functor f => (a -> f a) -> Complex a -> f (Complex a)  Access the  imaginaryPart of a  number D imaginary :: Functor f => (a -> f a) -> Complex a -> f (Complex a) This isn't quite a legal lens. Notably the   l ( l b a) = blaw is violated when you set a  value with 0  and non-zero   as the  information is lost. So don' t do that! )Otherwise, this is a perfectly cromulent . 0Traverse both the real and imaginary parts of a  number. N traverseComplex :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered(Traverse the typed value contained in a 7 where the type required by your function matches that  of the contents of the . b traverseDynamic :: (Applicative f, Typeable a, Typeable b) => (a -> f b) -> Dynamic -> f Dynamic portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered3A traversal for tweaking the left-hand value of an : traverseLeft ::  f => (a -> f b) ->  a c -> f ( b c)$traverse the right-hand value of an :   = egUnfortunately the instance for  e ( c) is still missing from base,  so this can' t just be eg traverseRight ::  f => (a -> f b) ->  c a -> f ( c a)portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered ,A lens reading and writing to the head of a  non-empty list [1,2,3]^._head1,A lens reading and writing to the tail of a  non-empty list _tail .~ [3,4,5] $ [1,2] [1,3,4,5]4A lens reading and writing to the last element of a  non-empty list  [1,2]^._last2=A lens reading and replacing all but the a last element of a  non-empty list [1,2,3,4]^._init[1,2,3]CObtain a version of the list with the supplied value interspersed. "abcde"^.interspersed ',' "a,b,c,d,e" ' xs^.interspersed a = intersperse a xs BObtain a version of the list with the supplied value intercalated QIndexed traversal of a list. The position in the list is available as the index. <The traversal for reading and writing to the head of a list MThe position of the head in the original list (0) is available as the index. traverseHead +~ 1 $ [1,2,3][2,2,3] = traverseHead :: Applicative f => (a -> f a) -> [a] -> f [a] *Traversal for editing the tail of a list. The position of each element in the original list is available as the index. traverseTail +~ 1 $ [1,2,3][1,3,4] = traverseTail :: Applicative f => (a -> f a) -> [a] -> f [a] %Traverse the last element in a list. QThe position of the last element in the original list is available as the index. traverseLast +~ 1 $ [1,2,3][1,2,4] = traverseLast :: Applicative f => (a -> f a) -> [a] -> f [a] ,Traverse all but the last element of a list 8The position of each element is available as the index. traverseInit +~ 1 $ [1,2,3][2,3,3] = traverseInit :: Applicative f => (a -> f a) -> [a] -> f [a]    portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered4Traverse both parts of a tuple with matching types. This provides a ) that checks a predicate on a key before ( allowing you to traverse into a value.  Rank2Types provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedThis L can be used to read, write or delete the value associated with a key in an . fromList [(1,"hello")] ^.at 1 Just "hello"#at 1 .~ Just "hello" $ IntMap.emptyfromList [(1,"hello")] C at :: Int -> (Maybe v -> f (Maybe v)) -> IntMap v -> f (IntMap v) Traversal of an  indexed by the key. /Traverse the value at a given key in an IntMap N traverseAt :: Applicative f => Int -> (v -> f v) -> IntMap v -> f (IntMap v)  traverseAt k = at k . traverse /Traverse the value at the minimum key in a Map :The key of the minimum element is available as the index. /Traverse the value at the maximum key in a Map portable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedThis 5 can be used to read, write or delete a member of an   0 ghci> contains 3 +~ False $ fromList [1,2,3,4]  fromList [1,2,4]  contains ::  f =>  -> (- -> f -) ->  -> f  IntSet isn't Foldable, but this ) can be used to access the members of an . &sumOf members $ setOf folded [1,2,3,4]10This ~* can be used to change the contents of an  by mapping  the elements to new values. Sadly, you can't create a valid  for a Set, because the number of B elements might change but you can manipulate it by reading using  and  reindexing it via setmap. (over setmapped (+1) (fromList [1,2,3,4])fromList [2,3,4,5] Construct an  from a , , ,  or . ":m + Data.IntSet.Lens Control.Lens5setOf (folded._2) [("hello",1),("world",2),("!!!",3)]fromList [1,2,3]   setOf ::  a  -> a ->   setOf ::  a  -> a ->   setOf ::   a  -> a ->   setOf ::   a  -> a ->   setOf ::   a  -> a ->    Rank2Types experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered ,Modify the target of a monoidally valued by ing another value.  :m + Control.Lens Data.Pair.Lens"both <>~ "!!!" $ ("hello","world")("hello!!!","world!!!")   ( ~) :: + c => ~ a b c c -> c -> a -> b  ( ~) :: + c =>  a b c c -> c -> a -> b  ( ~) :: + c =>  a b c c -> c -> a -> b  ( ~) :: + c =>  a b c c -> c -> a -> b Modify the target(s) of a  , , ~ or  by  ing a value.   ( =) :: (? a m, + b) =>  ~ a b -> b -> m ()  ( =) :: (? a m, + b) =>   a b -> b -> m ()  ( =) :: (? a m, + b) =>   a b -> b -> m ()  ( =) :: (? a m, + b) =>   a b -> b -> m () 2 a monoidal value onto the end of the target of a  and  return the result 3When you do not need the result of the operation, () is more flexible. 2 a monoidal value onto the end of the target of a  into  your monad's state and return the result. 3When you do not need the result of the operation, () is more flexible. Isomorphism for  Isomorphism for  Isomorphism for  0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _all foldMap [True,True]True0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _all foldMap [True,False]FalseIsomorphism for  0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _any foldMap [False,False]False0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _any foldMap [True,False]TrueIsomorphism for  0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _sum foldMap [1,2,3,4]10Isomorphism for  0:m + Control.Lens Data.Monoid.Lens Data.Foldableau _product foldMap [1,2,3,4]24Isomorphism for  Isomorphism for     !portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered A  that can access the nth element of a . =Note: This is only a legal lens if there is such an element! A  is isomorphic to a   viewl m = m^.viewL A  is isomorphic to a   viewr m = m^.viewR Traverse the head of a  Traverse the tail of a  Traverse the last element of a  'Traverse all but the last element of a  Traverse the first n elements of a  Traverse all but the first n elements of a  'Travere all the elements numbered from i to j of a     "MTPCs provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedA  that focuses on the root of a . A , of the direct descendants of the root of a  1 indexed by its position in the list of children #&MPTCs, Rank2Types, LiberalTypeSynonyms provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedAccess an element of an array. <Note: The indexed element is assumed to exist in the target .  arr  i = arr   i arr  [(i,e)] =  i  e 8 arr:ix 2 .~ 9 $ (listArray (1,5) [4,5,6,7,8] :: Array Int Int)+array (1,5) [(1,4),(2,9),(3,6),(4,7),(5,8)](This setter can be used to derive a new  from an old array by E applying a function to each of the indices to look it up in the old .  This is a  contravariant ~.   =  .   =  .   ( b) f arr  i = arr  f i  ( ( b) f arr) = bAn  of the elements of an  , using the 5 index into the array as the index of the traversal.  =  $ Rank2Types experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered (Modify the path by adding another path.  :m + Control.Lens Data.Pair.Lens#both </>~ "!!!" $ ("hello","world")("hello/!!!","world/!!!")   ( /~) :: ~ a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b Modify the target(s) of a  , , ~ or  by adding a path.   ( /=) :: ? a m =>  ~ a  ->  -> m ()  ( /=) :: ? a m =>   a  ->  -> m ()  ( /=) :: ? a m =>   a  ->  -> m ()  ( /=) :: ? a m =>   a  ->  -> m () +Add a path onto the end of the target of a  and return the result 3When you do not need the result of the operation, () is more flexible. +Add a path onto the end of the target of a  into  your monad's state and return the result. 3When you do not need the result of the operation, () is more flexible. %Modify the path by adding extension.  :m + Control.Lens Data.Pair.Lens#both <.>~ "!!!" $ ("hello","world")("hello.!!!","world.!!!")   ( /~) :: ~ a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b  ( /~) ::  a b   ->  -> a -> b Modify the target(s) of a  , , ~ or  by adding an extension.   ( .=) :: ? a m =>  ~ a  ->  -> m ()  ( .=) :: ? a m =>   a  ->  -> m ()  ( .=) :: ? a m =>   a  ->  -> m ()  ( .=) :: ? a m =>   a  ->  -> m () 1Add an extension onto the end of the target of a  and return the result 3When you do not need the result of the operation, () is more flexible. 1Add an extension onto the end of the target of a  into  your monad's state and return the result. 3When you do not need the result of the operation, () is more flexible. ,A lens reading and writing to the basename. )_basename .~ "filename" $ "path/name.png""path/filename.png"-A lens reading and writing to the directory. ""long/path/name.txt" ^. _directory "long/path"-A lens reading and writing to the extension. &_extension .~ ".png" $ "path/name.txt""path/name.png"1A lens reading and writing to the full filename. )_filename .~ "name.txt" $ "path/name.png""path/name.txt"    %portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered (or ) a list of bytes into a    x = x    x = x   Traverse each  in a    =   Y    ( 0x80) ::  -> - (or ) a list of characters into a  When writing back to the  it is assumed that every 5  lies between '\x00' and '\xff'.   x = x    x = x   #Traverse the individual bytes in a  as characters. When writing back to the  it is assumed that every 5  lies between '\x00' and '\xff'.   =  packed .    ( 'c') ::  -> -&portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered (or ) a list of bytes into a    x = x    x = x   #Traverse the individual bytes in a    =   .    ( 0x80) ::  -> - (or ) a list of characters into a  When writing back to the  it is assumed that every 5  lies between '\x00' and '\xff'.   x = x    x = x   #Traverse the individual bytes in a  as characters. When writing back to the  it is assumed that every 5  lies between '\x00' and '\xff'.   =   Y    ( 'c') ::  -> -'portable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedPack (or unpack) .  pack x = x^.packed  unpack x = x^.from packed >Traverse the individual characters in a either strict or lazy . $ anyOf text (=='c') :: Text -> Bool (portable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedPack (or unpack) .  pack x = x^.packed  unpack x = x^.from packed (Traverse the individual characters in a . $ anyOf text (=='c') :: Text -> Bool )portable provisionalEdward Kmett <ekmett@gmail.com> Safe-InferedEvaluate the targets of a  or  into a data structure " according to the given strategy.     =   =    = 4    evalOf ::   a b ->  b ->  a  evalOf ::   a b ->  b ->  a  evalOf :: (b ->  b) -> a ->  a) ->  b ->  a Evaluate the targets of a  or  according into a % data structure according to a given  in parallel.   =     parOf ::   a b ->  b ->  a  parOf ::   a b ->  b ->  a  parOf :: ((b ->  b) -> a ->  a) ->  b ->  a  Transform a , , , ~ or  to < first evaluates its argument according to a given strategy before proceeding.      ::  t =>  a ->  [a]  Transform a , , , ~ or  to 5 evaluate its argument according to a given strategy in parallel with evaluating.      ::  t =>  a ->  [a] *portable provisionalEdward Kmett <ekmett@gmail.com> Safe-Infered$Evaluate the elements targeted by a , , ,   or " according to the given strategy.  =  +GHC experimentalEdward Kmett <ekmett@gmail.com> Safe-InferedUsed to traverse  data by . ;Convert from the data type to its representation (or back) '"hello"^.generic.from generic :: String"hello";Convert from the data type to its representation (or back) A   that visits every occurence  of something  anywhere in a container. ?allOf every (=="Hello") (1::Int,2::Double,(),"Hello",["Hello"])True7mapMOf_ every putStrLn ("hello",[(2 :: Int, "world!")])helloworld!  eeg,K      !"-#$%&p'(vxwyz{|}~)*+, q r - o . / 0 1 2 3 4 5 6 7 8 9 b : : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T L U V W X Y Z [ \ J ] ^ N _ Q R ^ ` a S T b c 3 U d V W e f g h i j k l m n o 0 1 p q Y r Z [ \ ]s.tuvwx6/yz { h | } ~     O _    PM<=jmi            !!!!m!!!!!!""###$$$$$ $!$"$#$$$%$&$'%(%)%*%+&(&)&*&+','-(,(-).)/)0)1*2+3+4+5+67879:;<=>?@ABCBD7E@FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@GH@@L@@9@EGHB@@GGB`GLLGHGHLGGH eeeeeBBee@B@=G=I=?      !"!#!$!%&'()k*klk+k,k-./0123456789:;<=>=?=@ABCDECDFCDGCDHCDICDJKL@MNOPQRGSNTPUcdUVdWXYWXZWX[WX\WX]W^_G`abc+d+e+f+g+h+ijlens-2.4Control.Lens.TraversalControl.Lens.IsomorphicControl.Lens.InternalControl.Lens.IndexedControl.Lens.IndexedGetterControl.Lens.IndexedFoldControl.Lens.ActionControl.Lens.SetterControl.Lens.GetterControl.Lens.TypeControl.Lens.FoldControl.Lens.IsoControl.Lens.IndexedLensControl.Lens.IndexedTraversal Data.Map.LensControl.Lens.IndexedSetterControl.Lens.RepresentableControl.Lens.TupleControl.Lens.Zoom Data.Set.LensLanguage.Haskell.TH.LensControl.Lens.THControl.Exception.LensData.Bits.LensData.Complex.LensData.Dynamic.LensData.Either.LensData.List.LensData.Pair.LensData.IntMap.LensData.IntSet.LensData.Monoid.LensData.Sequence.LensData.Tree.LensData.Array.LensSystem.FilePath.LensData.ByteString.LensData.ByteString.Lazy.LensData.Text.LensData.Text.Lazy.Lens Control.Parallel.Strategies.LensControl.Seq.LensGHC.Generics.LensSettableSetter Traversalelement maximumOf minimumOfmapM_ traverseOf_Control.Monad.Trans.State.LazyState elementOf elementsOftraverseElementtraverseElementsOfLenscloneZoomzoomControl.Monad.ErrorErrorTControl.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ListListTControl.Monad.WriterWriterTControl.Monad.RWSRWSTControl.Monad.StateStateT backwards IndexedFoldFoldIndexedTraversal foldMapOfSimpleIndexedLensSimpleIndexedTraversalfoldrOffoldlOfanyOfallOfforOf_mapMOf_forMOf_ concatMapOf_findOffoldrOf'foldlOf'foldrMOffoldlMOftoListOf IndexedLens Control.MonadjoinSimpleData.Text.InternalTextData.Traversable fmapDefaulttraverseIsoboth imaginary Data.ComplexComplex traverseHeadControl.Lens.LensviewsetGettingGetterData.Functor.Compose getComposeCompose+~-~*~//~^~^^~**~||~&&~%=+=-=*=//=**=^^=||=&&=Preludeunfoldr Data.FoldablefoldMapfoldfoldrfoldltoListandoranyallproductsum traverse_ traverseLeftforM_ sequence_ maximumByfoldr1foldl1Offoldl1foldr'foldl'foldrMfoldlM Data.List transpose%@~%~ traverseOfforOfmapMOfforMOf mapAccumR mapAccumROf mapAccumL mapAccumLOfData.Distributive distribute Distributive Traversable Data.MonoidMonoidControl.Monad.Reader.Classlocal Control.LensData.ByteStringpackunpackData.ByteString.Char8Data.ByteString.LazyData.ByteString.Lazy.Char8base Isomorphism Isomorphic isomorphicisomapfromviaMutator runMutator untainted Effective effectiveAccessor runAccessorGettablecoerce EffectRWS getEffectRWSEffect getEffectKleeneMoreDone ElementOf getElementOfElementOfResultNotFoundFound SearchingMaxNoMaxMinNoMin Sequenced getSequenced Traversed getTraversed AppliedStaterunAppliedState IndexedStore FocusingErr unfocusingErrErrgetErr FocusingMay unfocusingMayMaygetMay FocusingOn unfocusingOn FocusingPlusunfocusingPlus FocusingWithunfocusingWithFocusing unfocusinggetMingetMaxkleene ineffectiveIndex withIndex IndexableIndexedindex<..>reindex<.>icomposeIndexedGetting IndexedGetter ifoldMapOfifoldrOfifoldlOfianyOfiallOf itraverseOf_iforOf_imapMOf_iforMOf_ iconcatMapOfifindOf ifoldrOf' ifoldlOf' ifoldrMOf ifoldlMOf itoListOf ifiltered itakingWhileidroppingWhileActing MonadicFoldActionperform^!actactsliftAct SimpleSetting SimpleSetterSettingmappedsetsovermapOf.~<.~.=^=<~<.=toviews^$^.useusesqueryqueriesSimpleOverloaded OverloadedLensLikeSimpleLensLike SimpleLenslens%%~%%=resultAtmerged alongside cloneLens<%~<+~<-~<*~~<>=<<>~<<>=_dual_endo_all_any_sum_product_firstviewLviewR traverseTo traverseFrom traverseSlicerootchildrenixixmapped traverseArray~=<~<=<.>~<.>=<<.>~<<.>= _basename _directory _extension _filename packedBytesbytes packedCharscharspackedtextevalOfparOfafter throughoutseqOf GTraversalgenericgeneric1everyControl.CategoryCategory.$fIsomorphicIsomorphism$fCategoryIsomorphism$fIsomorphic(->)transformers-0.3.0.0Data.Functor.IdentityIdentityGHC.BaseFunctorControl.Applicative ApplicativeConstidfmapghc-prim GHC.TypesInt Data.EitherEither Data.MaybeMaybe$fSettableBackwards$fSettableIdentity$fGettableElementOf$fApplicativeMutator$fFunctorMutator$fSettableMutator$fSettableCompose$fEffectivemrEffect$fEffectivemDualBackwards$fEffectiveIdentityrAccessor$fApplicativeAccessor$fFunctorAccessor$fGettableAccessor$fGettableEffectRWS$fGettableEffect$fGettableCompose$fGettableBackwards$fGettableConst$fApplicativeEffectRWS$fFunctorEffectRWS$fApplicativeEffect$fMonoidEffect$fFunctorEffect$fApplicativeKleene$fFunctorKleene$fApplicativeElementOf$fFunctorElementOf$fFunctorElementOfResult $fMonoidMax $fMonoidMin$fMonoidSequenced$fMonoidTraversed$fApplicativeAppliedState$fFunctorAppliedState$fFunctorIndexedStore$fApplicativeFocusingErr$fFunctorFocusingErr $fMonoidErr$fApplicativeFocusingMay$fFunctorFocusingMay $fMonoidMay$fApplicativeFocusingOn$fFunctorFocusingOn$fApplicativeFocusingPlus$fFunctorFocusingPlus$fApplicativeFocusingWith$fFunctorFocusingWith$fApplicativeFocusing$fFunctorFocusing$fIndexediIndex$fIndexedi(->)constBoolflipMonadNothingmap Data.TuplefstCharpure<$$GHC.NumNumGHC.Real FractionalIntegral GHC.FloatFloating GHC.Classes||&& mtl-2.1.2Control.Monad.State.Class MonadState MonadReaderstateFoldableGHC.Listrepeat replicate takeWhile dropWhilefor_ sequenceA_asum Alternativemsum MonadPluselemEqnotElem concatMapconcatlengthheadJust listToMaybelastTrueFalsenullmaximum fromMaybeGHC.ErrerrorOrdminimumOrdering $fMonoidGAfor sequenceAmapMforMsequence unwrapMonad WrapMonadscanr1scanl1containers-0.4.2.1Data.MapMapreturn<*>>>=$fRepresentable(->)$fRepresentableIdentity$fField9(,,,,,,,,)(,,,,,,,,)ii'$fField8(,,,,,,,,)(,,,,,,,,)hh'$fField8(,,,,,,,)(,,,,,,,)hh'$fField7(,,,,,,,,)(,,,,,,,,)gg'$fField7(,,,,,,,)(,,,,,,,)gg'$fField7(,,,,,,)(,,,,,,)gg'$fField6(,,,,,,,,)(,,,,,,,,)ff'$fField6(,,,,,,,)(,,,,,,,)ff'$fField6(,,,,,,)(,,,,,,)ff'$fField6(,,,,,)(,,,,,)ff'$fField5(,,,,,,,,)(,,,,,,,,)ee'$fField5(,,,,,,,)(,,,,,,,)ee'$fField5(,,,,,,)(,,,,,,)ee'$fField5(,,,,,)(,,,,,)ee'$fField5(,,,,)(,,,,)ee'$fField4(,,,,,,,,)(,,,,,,,,)dd'$fField4(,,,,,,,)(,,,,,,,)dd'$fField4(,,,,,,)(,,,,,,)dd'$fField4(,,,,,)(,,,,,)dd'$fField4(,,,,)(,,,,)dd'$fField4(,,,)(,,,)dd'$fField3(,,,,,,,,)(,,,,,,,,)cc'$fField3(,,,,,,,)(,,,,,,,)cc'$fField3(,,,,,,)(,,,,,,)cc'$fField3(,,,,,)(,,,,,)cc'$fField3(,,,,)(,,,,)cc'$fField3(,,,)(,,,)cc'$fField3(,,)(,,)cc'$fField2(,,,,,,,,)(,,,,,,,,)bb'$fField2(,,,,,,,)(,,,,,,,)bb'$fField2(,,,,,,)(,,,,,,)bb'$fField2(,,,,,)(,,,,,)bb'$fField2(,,,,)(,,,,)bb'$fField2(,,,)(,,,)bb'$fField2(,,)(,,)bb'$fField2(,)(,)bb'$fField1(,,,,,,,,)(,,,,,,,,)aa'$fField1(,,,,,,,)(,,,,,,,)aa'$fField1(,,,,,,)(,,,,,,)aa'$fField1(,,,,,)(,,,,,)aa'$fField1(,,,,)(,,,,)aa'$fField1(,,,)(,,,)aa'$fField1(,,)(,,)aa'$fField1(,)(,)aa'Control.Monad.Trans.RWS.Strict Control.Monad.Trans.State.StrictControl.Monad.Trans.Error$fMagnify(->)(->)Accessorba$fMagnifyIdentityTIdentityTkba$fMagnifyRWSTRWSTEffectRWSba$fMagnifyRWSTRWSTEffectRWSba0$fMagnifyReaderTReaderTEffectba$fZoomErrorTErrorTFocusingErrst$fZoomMaybeTMaybeTFocusingMayst$fZoomListTListTFocusingOnst"$fZoomWriterTWriterTFocusingPlusst#$fZoomWriterTWriterTFocusingPlusst0$fZoomRWSTRWSTFocusingWithst$fZoomRWSTRWSTFocusingWithst0$fZoomIdentityTIdentityTkst$fZoomReaderTReaderTkst$fZoomStateTStateTFocusingst$fZoomStateTStateTFocusingst0Data.SetSettemplate-haskellLanguage.Haskell.TH.SyntaxnewNameName$fSubstTypePred $fSubstType[]$fSubstTypeType$fHasTypeVars[]$fHasTypeVarsPred$fHasTypeVarsType$fHasTypeVarsName$fHasTypeVarsTyVarBndr $fHasNameCon $fHasNameName$fHasNameTyVarBndr GHC.Exception Exception SomeException Data.Bits.|.Bits.&.bitSize undefined integer-gmpGHC.Integer.TypeIntegerrealPartpolar magnitudephase Data.DynamicDynamic Data.IntMapIntMap Data.IntSetIntSetmappendDualEndoAllAnySumProductFirstLast Data.SequenceSeqViewLViewR Data.TreeTree array-0.4.0.0Data.Array.BaseIArray!//ixmapboundsamapGHC.IOFilePathStringbytestring-0.9.2.1Data.ByteString.Internal ByteStringGHC.WordWord8==Data.ByteString.Lazy.Internal text-0.11.2.3Data.Text.Lazy.Internalparallel-3.2.0.3Control.Parallel.StrategiesevalTraversableStrategyEvalparTraversablerdeepseq Control.Seq seqFoldable GHC.GenericsGenericData.Typeable.InternalTypeable$fGTraversal:.:$fGTraversalM1$fGTraversal:+:$fGTraversal:*:$fGTraversalU1$fGTraversalK1