h$x      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                                                       (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalGADTs, Rank2Types Safe-Inferred'(3 free A version of lift that can be used with any f.free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from  f to g.free$Given a natural transformation from f to g3 this gives a monoidal natural transformation from Alt f to Alt g.  3(C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalGADTs, Rank2Types Safe-Inferredfree The free  for any f.free A version of lift that can be used with f.free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from  f to g.free$Given a natural transformation from f to g3 this gives a monoidal natural transformation from Alt f to Alt g.(C) 2012-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalGADTs, Rank2Types Safe-Inferred'(3 free The free  for a  f."free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from  f to g."runAp t == retractApp . hoistApp t#free8Perform a monoidal analysis over free applicative value.Example: =count :: Ap f a -> Int count = getSum . runAp_ (\_ -> Sum 1) $free A version of lift that can be used with just a  for f.%freeTear down a free  using iteration.&free$Given a natural transformation from f to g3 this gives a monoidal natural transformation from Ap f to Ap g.'freeInterprets the free applicative functor over f using the semantics for  and ) given by the Applicative instance for f.retractApp == runAp id ! "#$%&' ! "#$%&' Safe-Inferred'(3O ,freeThe faster free ./freeThe free applicative is composed of a sequence of effects, and a pure function to apply that sequence to. The fast free applicative separates these from each other, so that the sequence may be built up independently, and so that  can run in constant time by having immediate access to the pure function.2free>Interprets the sequence of effects using the semantics for  and ' given by the Applicative instance for f.3free$Given a natural transformation from f to g* this gives a natural transformation from ASeq f to ASeq g.4free=Traverse a sequence with resepect to its interpretation type f.5freeIt may not be obvious, but this essentially acts like ++, traversing the first sequence and creating a new one by appending the second sequence. The difference is that this also has to modify the return functions and that the return type depends on the input types.See the source of 9 as an example usage.6free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from , f to g."runAp t == retractApp . hoistApp t7free8Perform a monoidal analysis over free applicative value.Example: =count :: Ap f a -> Int count = getSum . runAp_ (\_ -> Sum 1) 8free A version of lift that can be used with just a  for f.9free$Given a natural transformation from f to g3 this gives a monoidal natural transformation from Ap f to Ap g.:freeInterprets the free applicative functor over f using the semantics for  and ) given by the Applicative instance for f.retractApp == runAp id,-./0123456789:/012345,-.8:679(C) 2012-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalGADTs, Rank2Types Safe-Inferred,>free The free  for a  f.Afree$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from > f to g."runAp t == retractApp . hoistApp tBfree8Perform a monoidal analysis over free applicative value.Example: =count :: Ap f a -> Int count = getSum . runAp_ (\_ -> Sum 1) Cfree A version of lift that can be used with just a  for f.Dfree$Given a natural transformation from f to g3 this gives a monoidal natural transformation from Ap f to Ap g.EfreeInterprets the free applicative functor over f using the semantics for  and ) given by the Applicative instance for f.retractApp == runAp id>?@ABCDE>?@ABCDE(C) 2012-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalGADTs, Rank2Types Safe-Inferred'(3)7Ifree The free  for a  f.Jfree The free  for a  f.Kfree The free  transformer for a  f over  g.Nfree The free  for a  f.Qfree A version of lift) that can be used with no constraint for f.RfreeLift an action of the "outer"  g a to K f g a.SfreeGiven natural transformations f ~> h and  g . h ~> h& this gives a natural transformation  ApF f g ~> h.TfreeGiven natural transformations f ~> h and  g . h ~> h& this gives a natural transformation  ApT f g ~> h.Ufree!Perform a monoidal analysis over K f g b value. Examples:  height :: ( g,  g) => K f g a ->  height = getSum . runApT_ (_ -> Sum 1)   size :: ( g,  g) => K f g a ->  size = getSum . runApT_ (_ -> Sum 1)  Vfree$Given a natural transformation from f to f'3 this gives a monoidal natural transformation from ApF f g to ApF f' g.Wfree$Given a natural transformation from f to f'3 this gives a monoidal natural transformation from ApT f g to ApT f' g.Xfree$Given a natural transformation from g to g'3 this gives a monoidal natural transformation from ApF f g to ApF f g'.Yfree$Given a natural transformation from g to g'3 this gives a monoidal natural transformation from ApT f g to ApT f g'.ZfreePull out and join m layers of K f m a.[free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from J f to g."runAp t == retractApp . hoistApp t\free8Perform a monoidal analysis over free applicative value.Example:  count :: J f a ->  count = getSum . runAp_ (\_ -> Sum 1) ]freeInterprets the free applicative functor over f using the semantics for  and ) given by the Applicative instance for f.retractApp == runAp id^free$Given a natural transformation from f to g>, this gives a canonical monoidal natural transformation from I f to g.IJKLMNPOQRSTUVWXYZ[\]^KLMNPOQRTSUWVYXZJ[\]I^(C) 2008-2011 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalfundeps, MPTCs Safe-Inferred>*affree0Allows you to peel a layer off a cofree comonad.gfreeRemove a layer.fgfg(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred 38>.U ofree The cofree  of a functor f.pfree)This is a cofree comonad of some functor f, with a comonad w# threaded through it at each level.sfree;This is the base functor of the cofree comonad transformer.ufree$Extract the head of the base functorvfree%Extract the tails of the base functorwfree1Wrap another layer around a cofree comonad value.cofree is a right inverse of x. runCofree . cofree == id xfree2Unpeel the first layer off a cofree comonad value. runCofree is a right inverse of w. cofree . runCofree == id yfree#Lift a natural transformation from f to g" into a comonad homomorphism from p f w to p g wzfree Unfold a CofreeT= comonad transformer from a coalgebra and an initial comonad.fgopqrstuvwxyzpqrowxstfguvyzt5 (C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalnon-portable (fundeps, MPTCs) Safe-Inferred 9>5freeMonads provide substitution () and renormalization (): m  f =  ( f m)A free  is one that does no work during the normalization step beyond simply grafting the two monadic values together.[] is not a free  (in this sense) because  [[a]] smashes the lists flat.On the other hand, consider: ,data Tree a = Bin (Tree a) (Tree a) | Tip a   instance  Tree where  = Tip Tip a  f = f a Bin l r  f = Bin (l  f) (r  f) This  is the free  of Pair: data Pair a = Pair a a !And we could make an instance of  for it directly:  instance  Pair Tree where  (Pair l r) = Bin l r #Or we could choose to program with  Pair instead of Tree- and thereby avoid having to define our own  instance. Moreover, Control.Monad.Free.Church provides a  instance that can improve the  asymptotic complexity of code that constructs free monads by effectively reassociating the use of (+). You may also want to take a look at the kan-extensions package ( 1http://hackage.haskell.org/package/kan-extensions).See * for a more formal definition of the free  for a .free Add a layer. -wrap (fmap f x) D wrap (fmap return x) >>= f free=A version of lift that can be used with just a Functor for f.free;A version of wrap for monad transformers over a free monad.Note:- that this is the default implementation for  for MonadFree f (t m). (C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred;free$( ''T) provides free monadic actions for the constructors of the given data type T.freeLike , but does not provide type signatures. This can be used to attach Haddock comments to individual arguments for each generated function. data LangF x = Output String x makeFree_ 'LangF -- | Output a string. output :: MonadFree LangF m => String -- ^ String to output. -> m () -- ^ No result. 6 must be called *before* the explicit type signatures.free$( 'Con)6 provides free monadic action for a data constructor Con. Note that you can attach Haddock comment to the generated function by placing it before the top-level invocation of : *-- | Output a string. makeFreeCon 'Output freeLike , but does not provide a type signature. This can be used to attach Haddock comments to individual arguments. data LangF x = Output String x makeFreeCon_ 'Output -- | Output a string. output :: MonadFree LangF m => String -- ^ String to output. -> m () -- ^ No result. 5 must be called *before* the explicit type signature. Safe-Inferred;>5 (C) 2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred 3>FfreePlain iterative computations.free7The monad supporting iteration based over a base monad m.  ~ FreeT  free4Builds an iterative computation from one first step.runIter . iter == idfree3Executes the first step of an iterative computationiter . runIter == idfree*Adds an extra layer to a free monad value.'In particular, for the iterative monad , this makes the computation require one more step, without changing its final result.runIter (delay ma) == Right mafree is the left inverse of   .  =  free Tear down a Free  using iteration.freeLike  with monadic result.freeLift a monad homomorphism from m to n into a Monad homomorphism from  m to  n.freeLifts a plain, non-terminating computation into a richer environment.  is a  homomorphism.free#A computation that never terminatesfree1Repeatedly run a computation until it produces a  value. This can be useful when paired with a monad that has side effects.For example, we may have genId :: IO (Maybe Id) that uses a random number generator to allocate ids, but fails if it finds a collision. We can repeatedly run this with  ( genId) :: IO Id freeCuts off an iterative computation after a given number of steps. If the number of steps is 0 or less, no computation nor monadic effects will take place.The step where the final value is produced also counts towards the limit.Some examples (n D 0):  0 _ D    (n+1)   D     (n+1)   D      (n+1)   D  .  n  n  D   ( )  n Calling    n is always terminating, provided each of the steps in the iteration is terminating.freeInterleaves the steps of a finite list of iterative computations, and collects their results.The resulting computation has as many steps as the longest computation in the list.freeInterleaves the steps of a finite list of computations, and discards their results.The resulting computation has as many steps as the longest computation in the list.Equivalent to void  .free Capretta's race" combinator. Satisfies left catch.  Safe-Inferred 238>Qfree$The "free monad" for an applicative f.free0The "free monad transformer" for an applicative ffree"The base functor for a free monad.free4Evaluates the first layer out of a free monad value.free'Pushes a layer into a free monad value.free'Given an applicative homomorphism from f (m a) to m a6, tear down a free monad transformer using iteration.free'Given an applicative homomorphism from  f (t m a) to t m a, tear down a free monad transformer using iteration over a transformer.freeLift a monad homomorphism from m to n into a monad homomorphism from  f m to  f n  :: ( m,  f) => (m ~> n) ->  f m ~>  f nfree&Lift an applicative homomorphism from f to g into a monad homomorphism from  f m to  g mfreePull out and join m layers of  f m a.free is the left inverse of   .  =  free'Given an applicative homomorphism from f to , tear down a   using iteration.freeLike  for monadic values.freeCuts off a tree of computations at a given depth. If the depth is 0> or less, no computation nor monadic effects will take place.Some examples (n D 0):  0 _ D    (n+1)   D     (n+1)   D      (n+1)   D    ( n) Calling    n is always terminating, provided each of the steps in the iteration is terminating.freepartialIterT n phi m interprets first n layers of m using phi$. This is sort of the opposite for .Some examples (n D 0):  0 _ m D m  (n+1) phi   D   (n+1) phi   D   (n+1) phi   D  .  . phi freeintersperseT f m inserts a layer f between every two layers in m.  f   D   f   D   f   D    ( (  ( f)  )) free provisionalMPTCs, fundeps Safe-Inferred 238>]0freeThe "free monad" for a functor f.free+The "free monad transformer" for a functor ffree"The base functor for a free monad.free4Evaluates the first layer out of a free monad value.free'Pushes a layer into a free monad value.free3Tear down a free monad transformer using iteration.freeTear down a free monad transformer using iteration over a transformer.freeLift a monad homomorphism from m to n into a monad homomorphism from  f m to  f n  :: ( m,  f) => (m ~> n) ->  f m ~>  f nfreeThe very definition of a free monad transformer is that given a natural transformation you get a monad transformer homomorphism.free#Lift a natural transformation from f to g into a monad homomorphism from  f m to  g mfreePull out and join m layers of  f m a.free is the left inverse of   .  =  free Tear down a   using iteration.freeLike  for monadic values.freeCuts off a tree of computations at a given depth. If the depth is 0> or less, no computation nor monadic effects will take place.Some examples (n D 0):  0 _ D    (n+1)   D     (n+1)   D      (n+1)   D    ( n) Calling    n is always terminating, provided each of the steps in the iteration is terminating.freepartialIterT n phi m interprets first n layers of m using phi$. This is sort of the opposite for .Some examples (n D 0):  0 _ m D m  (n+1) phi   D   (n+1) phi   D   (n+1) phi   D  .  . phi freeintersperseT f m inserts a layer f between every two layers in m.  f   D   f   D   f   D    ( (  ( f)  )) free provisional)non-portable (rank-2 polymorphism, MTPCs) Safe-Inferred>h@freeThe "free monad" for a functor f.free+The "free monad transformer" for a functor ffree8Generate a Church-encoded free monad transformer from a  monad transformer.free Convert to a  free monad representation.free Unwrap the 4 monad to obtain it's Church-encoded representation.freeWrap a Church-encoding of a "free monad" as the free monad for a functor.free3Tear down a free monad transformer using iteration.freeTear down a free monad transformer using iteration over a transformer.freeLift a monad homomorphism from m to n into a monad homomorphism from  f m to  f n  :: ( m,  n,  f) => (m ~> n) ->  f m ~>  f nfree#Lift a natural transformation from f to g into a monad homomorphism from  f m to  g nfreePull out and join m layers of  f m a.freeCuts off a tree of computations at a given depth. If the depth is 0 or less, no computation nor monadic effects will take place.Some examples (n D 0):'cutoff 0 _ == return Nothing&cutoff (n+1) . return == return . Just,cutoff (n+1) . lift == lift . liftM Just0cutoff (n+1) . wrap == wrap . fmap (cutoff n)Calling 'retract . cutoff n' is always terminating, provided each of the steps in the iteration is terminating.free is the left inverse of   .  =  freeTear down a free monad transformer using iteration over a transformer.free Tear down an   using iteration.freeLike  for monadic values.free-Convert to another free monad representation.free,Generate a Church-encoded free monad from a  monad.freeImprove the asymptotic performance of code that builds a free monad with only binds and returns by using  behind the scenes.This is based on the "Free Monads for Less" series of articles by Edward Kmett: 4http://comonad.com/reader/2011/free-monads-for-less/ 6http://comonad.com/reader/2011/free-monads-for-less-2/and "Asymptotic Improvement of Computations over Free Monads" by Janis Voightlnder: (http://www.iai.uni-bonn.de/~jv/mpc08.pdffreeImprove the asymptotic performance of code that builds a free monad transformer with only binds and returns by using  behind the scenes. Similar to . Safe-Inferred 38>p^free!A free monad given an applicativefree is the left inverse of  and   .  =   .  =  free'Given an applicative homomorphism from f to Identity, tear down a   using iteration.freeLike  for applicative values.freeLike  for monadic values.free&Lift an applicative homomorphism from f to g into a monad homomorphism from  f to  g.freeGiven an applicative homomorphism, you get a monad homomorphism.free Convert a  monad from Control.Monad.Free.Ap to a  monad from Control.Monad.Trans.Free.Ap. WARNING: This assumes that  is an applicative homomorphism.freeCuts off a tree of computations at a given depth. If the depth is 0 or less, no computation nor monadic effects will take place.Some examples (n D 0):'cutoff 0 _ == return Nothing&cutoff (n+1) . return == return . Just,cutoff (n+1) . lift == lift . liftM Just0cutoff (n+1) . wrap == wrap . fmap (cutoff n)Calling 'retract . cutoff n' is always terminating, provided each of the steps in the iteration is terminating.free Unfold a free monad from a seed.free-Unfold a free monad from a seed, monadically.freeThis is Prism' (Free f a) a in disguisepreview _Pure (Pure 3)Just 3 review _Pure 3 :: Free Maybe IntPure 3freeThis is  Prism' (Free f a) (f (Free f a)) in disguise,preview _Free (review _Free (Just (Pure 3)))Just (Just (Pure 3))review _Free (Just (Pure 3))Free (Just (Pure 3))freeThis is not a true monad transformer. It is only a monad transformer "up to ".free3This violates the MonadPlus laws, handle with care.free5This violates the Alternative laws, handle with care.(C) 2008-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundepsNone 238>freeThe   for a  f.FormallyA  n is a free  for f# if every monad homomorphism from n to another monad m1 is equivalent to a natural transformation from f to m. Why Free?Every "free" functor is left adjoint to some "forgetful" functor.!If we define a forgetful functor U from the category of monads to the category of functors that just forgets the , leaving only the . i.e. U (M,,) = Mthen  is the left adjoint to U. being left adjoint to U+ means that there is an isomorphism between f -> m in the category of monads and f -> U m in the category of functors.(Morphisms in the category of monads are 5 homomorphisms (natural transformations that respect  and ).*Morphisms in the category of functors are ) homomorphisms (natural transformations).6Given this isomorphism, every monad homomorphism from  f to m0 is equivalent to a natural transformation from f to m;Showing that this isomorphism holds is left as an exercise.!In practice, you can just view a  f a as many layers of f wrapped around values of type a , where ()0 performs substitution and grafts new layers of f# in for each of the free variables.This can be very useful for modeling domain specific languages, trees, or other constructs.This instance of  is fairly naive about the encoding. For more efficient free monad implementation see Control.Monad.Free.Church, in particular note the 6 combinator. You may also want to take a look at the kan-extensions package ( 1http://hackage.haskell.org/package/kan-extensions)./A number of common monads arise as free monads,Given  data Empty a,  Empty is isomorphic to the  monad.  can be used to model a partiality monad where each layer represents running the computation for a while longer.free is the left inverse of  and   .  =   .  =  free Tear down a   using iteration.freeLike  for applicative values.freeLike  for monadic values.free#Lift a natural transformation from f to g$ into a natural transformation from  f to  g.freeThe very definition of a free monad is that given a natural transformation you get a monad homomorphism.free Convert a  monad from Control.Monad.Free to a  monad from Control.Monad.Trans.Free.freeCuts off a tree of computations at a given depth. If the depth is 0 or less, no computation nor monadic effects will take place.Some examples (n D 0):'cutoff 0 _ == return Nothing&cutoff (n+1) . return == return . Just,cutoff (n+1) . lift == lift . liftM Just0cutoff (n+1) . wrap == wrap . fmap (cutoff n)Calling 'retract . cutoff n' is always terminating, provided each of the steps in the iteration is terminating.free Unfold a free monad from a seed.free-Unfold a free monad from a seed, monadically.freeThis is Prism' (Free f a) a in disguisepreview _Pure (Pure 3)Just 3 review _Pure 3 :: Free Maybe IntPure 3freeThis is 9Prism (Free f a) (Free g a) (f (Free f a)) (g (Free g a)) in disguise,preview _Free (review _Free (Just (Pure 3)))Just (Just (Pure 3))review _Free (Just (Pure 3))Free (Just (Pure 3))freeThis is not a true monad transformer. It is only a monad transformer "up to ".free3This violates the MonadPlus laws, handle with care.free5This violates the Alternative laws, handle with care.(C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisional"non-portable (rank-2 polymorphism)None >r free,The Church-encoded free monad for a functor f.It is asymptotically more efficient to use () for  than it is to () with . 6http://comonad.com/reader/2011/free-monads-for-less-2/free Tear down a   using iteration.freeLike iter for monadic values.free is the left inverse of  and   .  =   .  =  free#Lift a natural transformation from f to g$ into a natural transformation from F f to F g.freeThe very definition of a free monad is that given a natural transformation you get a monad homomorphism.free-Convert to another free monad representation.free,Generate a Church-encoded free monad from a  monad.freeImprove the asymptotic performance of code that builds a free monad with only binds and returns by using  behind the scenes.This is based on the "Free Monads for Less" series of articles by Edward Kmett: 4http://comonad.com/reader/2011/free-monads-for-less/Free monads for less @ Part 1 6http://comonad.com/reader/2011/free-monads-for-less-2/Free monads for less @ Part 2and  (http://www.iai.uni-bonn.de/~jv/mpc08.pdf9"Asymptotic Improvement of Computations over Free Monads" by Janis Voightlnder.freeCuts off a tree of computations at a given depth. If the depth is 0 or less, no computation nor monadic effects will take place.Some examples (n D 0):'cutoff 0 _ == return Nothing&cutoff (n+1) . return == return . Just*cutoff (n+1) . lift == lift . liftM Just/cutoff (n+1) . wrap == wrap . fmap (cutoff n)Calling  .  n is always terminating, provided each of the steps in the iteration is terminating.free3This violates the MonadPlus laws, handle with care.free5This violates the Alternative laws, handle with care.(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundeps Safe-Inferred3>freeThe coiterative comonadfree6This is the coiterative comonad generated by a comonadfree/Prepends a result to a coiterative computation. runCoiter . uncurry coiter == idfree9Extracts the first result from a coiterative computation. uncurry coiter . runCoiter == idfree Unfold a CoiterT comonad transformer from a cokleisli arrow and an initial comonadic seed. fg fg(C) 2008-2013 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalMPTCs, fundepsNone 238>1 freeThe   of a functor f.FormallyA  v is a cofree  for f5 if every comonad homomorphism from another comonad w to v1 is equivalent to a natural transformation from w to f.A cofree1 functor is right adjoint to a forgetful functor.Cofree is a functor from the category of functors to the category of comonads that is right adjoint to the forgetful functor from the category of comonads to the category of functors that forgets how to  and , leaving you with only a .In practice, cofree comonads are quite useful for annotating syntax trees, or talking about streams.>A number of common comonads arise directly as cofree comonads. For instance, ( forms the comonad for a non-empty list. ( b) is a product. Identity forms an infinite stream. ((->) b)' describes a Moore machine with states labeled with values of type a, and transitions on edges of type b.Furthermore, if the functor f7 forms a monoid (for example, by being an instance of ), the resulting  is also a . See  5http://www.cs.appstate.edu/~johannp/jfp06-revised.pdf/Monadic Augment and Generalised Shortcut Fusion5 by Neil Ghani et al., Section 4.3 for more details.In particular, if  f a D [a]%, the resulting data structure is a  'https://en.wikipedia.org/wiki/Rose_tree Rose tree'. For a practical application, check  https://web.archive.org/web/20161208002902/http://www.cs.le.ac.uk/people/ak155/Papers/CALCO-07/GK07.pdf'Higher Dimensional Trees, Algebraically by Neil Ghani et al.free9Use coiteration to generate a cofree comonad from a seed.  f =  (  f)free!Like coiter for comonadic values.free$Unfold a cofree comonad from a seed.free1Unfold a cofree comonad from a seed, monadically.free  .  = freeThis is a lens that can be used to read or write from the target of .Using (^.) from the lens package: foo ^.  ==  fooFor more on lenses see the lens package on hackage  :: Lens' ( g a) afreeThis is a lens that can be used to read or write to the tails of a  .Using (^.) from the lens package: foo ^.  == g fooFor more on lenses see the lens package on hackage  :: Lens' ( g a) (g ( g a))free Construct an Lens into a  g given a list of lenses into the base functor. When the input list is empty, this is equivalent to . When the input list is non-empty, this composes the input lenses with  to walk through the  g before using * to get the element at the final location.For more on lenses see the lens package on hackage. telescoped :: [Lens' (g ( g a)) ( g a)] -> Lens' ( g a) a telescoped :: [Traversal' (g ( g a)) ( g a)] -> Traversal' ( g a) a telescoped :: [Getter (g ( g a)) ( g a)] -> Getter ( g a) a telescoped :: [Fold (g ( g a)) ( g a)] -> Fold ( g a) a telescoped :: [Setter' (g ( g a)) ( g a)] -> Setter' ( g a) afree Construct an Lens into a  g given a list of lenses into the base functor. The only difference between this and  is that  focuses on a single value, but this focuses on the entire remaining subtree. When the input list is empty, this is equivalent to . When the input list is non-empty, this composes the input lenses with  to walk through the  g.For more on lenses see the lens package on hackage. telescoped :: [Lens' (g ( g a)) ( g a)] -> Lens' ( g a) ( g a) telescoped :: [Traversal' (g ( g a)) ( g a)] -> Traversal' ( g a) ( g a) telescoped :: [Getter (g ( g a)) ( g a)] -> Getter ( g a) ( g a) telescoped :: [Fold (g ( g a)) ( g a)] -> Fold ( g a) ( g a) telescoped :: [Setter' (g ( g a)) ( g a)] -> Setter' ( g a) ( g a)freeA  Traversal'# that gives access to all non-leaf a elements of a  g! a, where non-leaf is defined as x from  (x :< xs) where null xs is False.6Because this doesn't give access to all values in the  g%, it cannot be used to change types. 4shoots :: Traversable g => Traversal' (Cofree g a) aN.B. On GHC < 7.9, this is slightly less flexible, as it has to use null (toList xs) instead.freeA  Traversal' that gives access to all leaf a elements of a  g a, where leaf is defined as x from  (x :< xs) where null xs is True.6Because this doesn't give access to all values in the  g%, it cannot be used to change types. 4shoots :: Traversable g => Traversal' (Cofree g a) aN.B. On GHC < 7.9, this is slightly less flexible, as it has to use null (toList xs) instead.freeThis is not a true . transformer, but this instance is convenient.fgfg5 !"#$%&'()*+,-."#$%&'(*), ! /012345678  9:;<=>?@/0134678  A/0134678 BBCD! EFGHIJKLMN/04#OPQRSTUVWXYZ[\]^_``abcdefghijklmnopqrstuvwxyz{|}~                                                                               !                                                                      !                                                                  !!_c!free-5.1.5-BHOVxTWFlMc270tdZ1aH6qControl.Alternative.FreeControl.Alternative.Free.FinalControl.Applicative.FreeControl.Applicative.Free.FastControl.Applicative.Free.FinalControl.Applicative.Trans.FreeControl.Comonad.Cofree.ClassControl.Comonad.Trans.CofreeControl.Monad.Free.ClassControl.Monad.Free.THControl.Monad.Trans.IterControl.Monad.Trans.Free.ApControl.Monad.Trans.FreeControl.Monad.Trans.Free.ChurchControl.Monad.Free.ApControl.Monad.FreeControl.Monad.Free.ChurchControl.Comonad.Trans.CoiterControl.Comonad.CofreeFreeData.Functor.Classes.Compat Control.Monadjoinimprove Data.FunctorIdentity Control.Arrow&&&Alt alternativesAltFApPureliftAltrunAlthoistAlt $fMonoidAlt$fSemigroupAlt$fAlternativeAlt$fAltAlt $fApplyAlt$fApplicativeAlt$fApplicativeAltF $fFunctorAlt $fFunctorAltF_runAltrunAprunAp_liftApiterAphoistAp retractAp $fComonadAp$fApplicativeAp $fApplyAp $fFunctorApunApASeqANilACons reduceASeq hoistASeq traverseASeq rebaseASeq_runApApTgetApTApFliftApTliftApOrunApFrunApTrunApT_hoistApFhoistApTtransApFtransApTjoinApT$fAlternativeApT $fApplyApT $fApplyApF$fApplicativeApT$fApplicativeApF $fFunctorApT $fFunctorApF ComonadCofreeunwrap$fComonadCofreefTracedT$fComonadCofreefStoreT$fComonadCofreefEnvT$fComonadCofreefIdentityT$fComonadCofreeConst(,)$fComonadCofree[]Tree$fComonadCofreeMaybeNonEmptyCofreeCofreeT runCofreeTCofreeF:<headFtailFcofree runCofree transCofreeTcoiterT $fDataCofreeF$fBitraversableCofreeF$fBifoldableCofreeF$fBifunctorCofreeF$fTraversableCofreeF$fFoldableCofreeF$fFunctorCofreeF $fOrd1CofreeF $fOrd2CofreeF $fEq1CofreeF $fEq2CofreeF$fRead1CofreeF$fRead2CofreeF$fShow1CofreeF$fShow2CofreeF $fDataCofreeT$fMonadZipCofreeT$fMonadTransCofreeT$fApplicativeCofreeT$fMonadCofreeT $fOrdCofreeT $fEqCofreeT $fReadCofreeT $fShowCofreeT$fComonadHoistCofreeT$fComonadEnveCofreeT$fComonadCofreefCofreeT$fComonadTransCofreeT$fTraversableCofreeT$fFoldableCofreeT$fComonadCofreeT$fFunctorCofreeT $fEqCofreeF $fOrdCofreeF $fShowCofreeF $fReadCofreeF$fGenericCofreeF$fGeneric1TYPECofreeF MonadFreewrapliftFwrapT$fMonadFreefExceptT$fMonadFreefErrorT$fMonadFreefListT$fMonadFreefIdentityT$fMonadFreefMaybeT$fMonadFreefRWST$fMonadFreefRWST0$fMonadFreefWriterT$fMonadFreefWriterT0$fMonadFreefContT$fMonadFreefStateT$fMonadFreefStateT0$fMonadFreefReaderTmakeFree makeFree_ makeFreeCon makeFreeCon_ $fShowArgIterIterTrunIterTiterrunIterdelayretractfoldfoldM hoistIterTliftIternever untilJustcutoff interleave interleave_ $fDataIterT$fSemigroupIterT $fMonoidIterT$fMonadCatchIterT$fMonadThrowIterT$fMonadFreeIdentityIterT$fMonadContIterT$fMonadIOIterT$fMonadErroreIterT$fMonadStatesIterT$fMonadWriterwIterT$fMonadReadereIterT$fTraversable1IterT$fTraversableIterT$fFoldable1IterT$fFoldableIterT$fMonadTransIterT$fMonadPlusIterT$fAlternativeIterT$fMonadFixIterT $fBindIterT $fApplyIterT$fMonadFailIterT $fMonadIterT$fApplicativeIterT$fFunctorIterT $fReadIterT $fRead1IterT $fShowIterT $fShow1IterT $fOrdIterT $fOrd1IterT $fEqIterT $fEq1IterTFreeTrunFreeTFreeFrunFreefreeiterTiterTM hoistFreeT transFreeT joinFreeTiterM partialIterT intersperseTretractT intercalateT$fBitraversableFreeF$fBifoldableFreeF$fBifunctorFreeF$fTraversableFreeF$fFoldableFreeF$fFunctorFreeF $fOrd1FreeF $fOrd2FreeF $fEq1FreeF $fEq2FreeF $fRead1FreeF $fRead2FreeF $fShow1FreeF $fShow2FreeF$fTraversableFreeT$fFoldableFreeT$fMonadCatchFreeT$fMonadThrowFreeT$fMonadFreefFreeT$fMonadPlusFreeT$fAlternativeFreeT$fMonadContFreeT$fMonadErroreFreeT$fMonadStatesFreeT$fMonadWriterwFreeT$fMonadReaderrFreeT$fMonadIOFreeT$fMonadTransFreeT$fMonadFailFreeT $fMonadFreeT $fBindFreeT $fApplyFreeT$fApplicativeFreeT$fFunctorFreeT $fReadFreeT $fRead1FreeT $fShowFreeT $fShow1FreeT $fOrd1FreeT $fOrdFreeT $fEq1FreeT $fEqFreeT $fEqFreeF $fOrdFreeF $fShowFreeF $fReadFreeF$fGenericFreeF$fGeneric1TYPEFreeF foldFreeT$fMonadBasebFreeTFFTrunFTtoFTfromFTrunFhoistFTtransFTjoinFTfromFtoFimproveT$fMonadCatchFT$fMonadThrowFT$fMonadStatesFT$fMonadWriterwFT$fMonadReaderrFT $fMonadContFT$fMonadErroreFT $fMonadIOFT$fTraversableFT $fFoldableFT $fMonadPlusFT$fAlternativeFT$fMonadTransFT$fMonadFreefFT $fMonadFT$fBindFT$fApplicativeFT $fApplyFT $fFunctorFT$fOrdFT$fEqFT$fOrd1FT$fEq1FTiterA hoistFreefoldFreetoFreeTunfoldunfoldM_Pure_Free$fMonadFreefFree$fMonadContFree$fMonadErroreFree$fMonadStatesFree$fMonadReadereFree$fMonadWritereFree$fTraversable1Free$fTraversableFree$fFoldable1Free$fFoldableFree$fMonadTransFree$fMonadPlusFree$fAlternativeFree$fMonadFixFree $fMonadFree $fBindFree$fApplicativeFree $fApplyFree $fFunctorFree $fReadFree $fRead1Free $fShowFree $fShow1Free $fOrdFree $fOrd1Free$fEqFree $fEq1Free $fGenericFree$fGeneric1TYPEFree$fTraversableWithIndex[]Free$fFoldableWithIndex[]Free$fFunctorWithIndex[]Free $fDataFreehoistFfoldF $fMonadContF$fMonadWriterwF$fMonadReadereF$fMonadStatesF $fMonadFreefF $fMonadTransF $fMonadPlusF$fTraversable1F $fFoldable1F$fTraversableF $fFoldableF $fMonadFixF$fMonadF$fBindF$fAlternativeF$fApplicativeF$fApplyF $fFunctorFCoiterCoiterT runCoiterTcoiter runCoiter $fDataCoiterT $fOrdCoiterT $fEqCoiterT $fReadCoiterT $fShowCoiterT$fComonadStoresCoiterT$fComonadTracedmCoiterT$fComonadHoistCoiterT$fComonadEnveCoiterT$fComonadCofreeIdentityCoiterT$fComonadTransCoiterT$fTraversableCoiterT$fFoldableCoiterT$fComonadCoiterT$fFunctorCoiterT$fRead1CoiterT$fShow1CoiterT $fOrd1CoiterT $fEq1CoiterTcoiterW hoistCofreesection_extract_unwrap telescoped telescoped_shootsleaves$fComonadTracedmCofree$fComonadStoresCofree$fComonadEnveCofree$fComonadHoistCofree$fTraversableWithIndex[]Cofree$fFoldableWithIndex[]Cofree$fFunctorWithIndex[]Cofree$fTraversable1Cofree$fTraversableCofree$fFoldable1Cofree$fFoldableCofree $fOrd1Cofree $fOrdCofree $fEq1Cofree $fEqCofree $fReadCofree $fRead1Cofree $fShowCofree $fShow1Cofree$fApplicativeCofree$fComonadApplyCofree $fApplyCofree$fMonadZipCofree $fMonadCofree$fComonadTransCofree$fComonadCofree$fExtendCofree$fFunctorCofree$fDistributiveCofree$fComonadCofreefCofree$fGenericCofree$fGeneric1TYPECofree $fDataCofreebaseGHC.Base Alternative ApplicativeFunctorpure<*>fmap Data.FoldableFoldableghc-prim GHC.TypesIntmaximum$comonad-5.0.7-DXeGfG4ctVzI3WlwhyxGRUControl.ComonadComonad>>=MonadreturnmappendData.Functor.Classes showsBinary1 showsUnary1 showsUnary readsBinary1 readsUnary1 readsUnaryshowsBinaryWithshowsUnaryWithreadBinaryWithreadsBinaryWith readUnaryWithreadsUnaryWithreadData readsData showsPrec2liftReadListPrec2DefaultliftReadList2Default readPrec2 readsPrec2compare2eq2 showsPrec1liftReadListPrecDefaultliftReadListDefault readPrec1 readsPrec1compare1eq1Eq1liftEqOrd1 liftCompareRead1liftReadListPrec liftReadPrec liftReadsPrec liftReadListShow1 liftShowsPrec liftShowListEq2liftEq2Ord2 liftCompare2Read2liftReadListPrec2 liftReadPrec2liftReadsPrec2 liftReadList2Show2liftShowsPrec2 liftShowList2Data.Functor.Identitytransformers-0.5.6.2Control.Monad.Trans.Classliftid GHC.MaybeJustNothing.liftMGHC.Listiterate!!<$Maybeextract duplicateData.Functor.ConstConstControl.CategoryControl.Comonad.Trans.Classlower