!ߴ>      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                            !"#$%&'()*+,-./0123456789:; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                              (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone %24567UV_gTGfunctor-combinators A list of f aHs. Can be used to describe a product of many different values of type f a.This is the Free .,functor-combinatorsA non-empty list of f aVs. Can be used to describe a product between many different possible values of type f a. Essentially: ,/ f ~ f -- one f  (f  f) -- two f's :+: (f :*: f :*: f) -- three f's :+: (f :*: f :*: f :*: f) -- four f's :+: ... -- etc. This is the Free ./functor-combinators$Map a function over the inside of a .Efunctor-combinatorsA maybe f a.#Can be useful for describing a "an f a that may or may not be there".MThis is the free structure for a "fail"-like typeclass that would only have  zero :: f a.Hfunctor-combinatorsTreat a , f as a product between an f and a  f.I is the record accessor.Jfunctor-combinators$Map a function over the inside of a ,.Kfunctor-combinators Convert a , into a  with at least one item.Lfunctor-combinators Convert a  either a ,, or a & in the case that the list was empty.^functor-combinators A map of f as, indexed by keys of type kP. It can be useful for represeting a product of many different values of type f a, each "at" a different k location.#Can be considered a combination of  and , in a way --- a ^ k f a is like a  ( k f) a! with unique (and ordered) keys.VOne use case might be to extend a schema with many "options", indexed by some string.LFor example, if you had a command line argument parser for a single command data Command a :Then you can represent a command line argument parser for multiple named commands with type Commands = ^  Command See wQ for a non-empty variant, if you want to enforce that your bag has at least one f a.afunctor-combinators$Map a function over the inside of a E.bfunctor-combinators Convert a E into a  with zero or one items.cfunctor-combinators Convert a  into a E containing the first f a in the list, if it exists.ffunctor-combinatorsPicks the first .wfunctor-combinatorsA non-empty map of f as, indexed by keys of type kP. It can be useful for represeting a product of many different values of type f a, each "at" a different k0 location, where you need to have at least one f a at all times.#Can be considered a combination of  and ,, in a way --- an w k f a is like a , ( k f) a! with unique (and ordered) keys.See ^ for some use cases.|functor-combinatorsLeft-biased union~functor-combinators&A union, combining matching keys with .functor-combinatorsLeft-biased unionfunctor-combinators&A union, combining matching keys with .,HI-./EFGJKL^_`abcwxy/,HI-.HJKLEFGacb^_`wxy(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone%&'=?@AEHSUVX_fgk5functor-combinatorsFunctor composition.  f g a is equivalent to f (g a) , and the ) pattern synonym is a way of getting the f (g a) in a  f g a. For example,  (  ) is     .CThis is mostly useful for its typeclass instances: in particular, !, ", , and .!This is essentially a version of # and  that allows for an  instance.'It is slightly less performant. Using  . * every once in a while will concretize a  value (if you have ! fG) and remove some indirection if you have a lot of chained operations.The "free monoid" over  is !, and the "free semigroup" over  is .functor-combinators The Free $. Imbues any functor f with a $ instance.Conceptually, this is "* without pure". That is, while normally  f a is an a, a f a, a f (f a) , etc., a  f a is an f a, f (f a),  f (f (f a)), etc. It's a  with "at least one layer of f", excluding the a case.,It can be useful as the semigroup formed by #. (functor composition): Sometimes we want an f :.: f, or an  f :.: f :.: f, or an f :.: f :.: f :.: f(...just as long as we have at least one f.functor-combinatorsA  f is fV enhanced with "sequential binding" capabilities. It allows you to sequence multiple f4s one after the other, and also to determine "what f= to sequence" based on the result of the computation so far..Essentially, you can think of this as "giving f a %) instance", with all that that entails (&, ', etc.).Lift f into it with  :: f a -> Free f aU. When you finally want to "use" it, you can interpret it into any monadic context:  :: %( g => (forall x. f x -> g x) ->  f a -> g a IStructurally, this is equivalent to many "nested" f's. A value of type  f a is either: a f a f (f a)  f (f (f a)).. etc.?Under the hood, this is the Church-encoded Freer monad. It's , or (, but in a way that is compatible with  and .functor-combinators!Pattern match on and construct a  f g a as if it were f (g a).functor-combinators(Constructor matching on the case that a  f is a nested f ( f a). Used as a part of the ( and ) instances.(As a constructor, this is equivalent to *.functor-combinators(Constructor matching on the case that a  f& consists of just a single un-nested f. Used as a part of the ( and ) instances.functor-combinators Convert a  f into any instance of + f.functor-combinatorsLift an f into  f, so you can use it as a %.This is .functor-combinators Interpret a  f into a context g, provided that g has a % instance.This is  .functor-combinators Extract the fs back "out" of a  f, utilizing its % instance.This is  .functor-combinators'Swap out the underlying functor over a /. This preserves all of the structure of the .functor-combinators A version of  that doesn't require ! fF, by taking a RankN folding function. This is essentially a flipped .functor-combinators A version of  that doesn't require ! f, by folding over a  instead.functor-combinatorsRecursively fold down a  by handling the ,# case and the nested/wrapped case.This is a catamorphism.This requires ! f; see  and % for a version that doesn't require ! f.functor-combinators Convert a  f into any instance of + f.functor-combinators f is a special subset of  f' that consists of at least one nested f0. This converts it back into the "bigger" type.See ? for a version that preserves the "one nested layer" property.functor-combinators#Map the underlying functor under a .functor-combinators Because a  f is just a  f$ with at least one nested layer of f5, this function converts it back into the one-nested-f format.functor-combinators Inject an f into a  ffunctor-combinators Retract the f out of a  f, as long as the f implements $%. Since we always have at least one f, we do not need a full % constraint.functor-combinatorsInterpret the  f in some context g, provided that g has a $. instance. Since we always have at least one f$, we will always have at least one g, so we do not need a full % constraint.functor-combinatorsA  f is either a single un-nested f, or a f nested with another  f". This decides which is the case.functor-combinators A version of  that doesn't require ! fF, by taking a RankN folding function. This is essentially a flipped .functor-combinators A version of  that doesn't require ! f, by folding over a  instead.functor-combinatorsRecursively fold down a  by handling the single f# case and the nested/wrapped case.This is a catamorphism.This requires ! f; see  and % for a version that doesn't require ! f.functor-combinators"Smart constructor" for  that doesn't require ! f.functor-combinatorsRead in terms of , and *.functor-combinatorsShow in terms of , and *.functor-combinatorsRead in terms of  and .functor-combinatorsShow in terms of  and .functor-combinatorshandle ,functor-combinatorshandle *functor-combinatorshandle ,functor-combinatorshandle *functor-combinatorshandle .functor-combinatorshandle . #(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableSafe4SUVXfunctor-combinators'Profunctor that allows us to implement .functor-combinators2The type of an isomorphism between two functors. f  g means that f and g are isomorphic to each other.We can effectively use an f <~> g with:  :: (f <~> g) -> f a -> g a  :: (f <~> g) -> g a -> a a Use  to extract the "f to g" function, and  to extract the "g to f^" function. Reviewing and viewing the same value (or vice versa) leaves the value unchanged.9One nice thing is that we can compose isomorphisms using - from Prelude: (-+) :: f <~> g -> g <~> h -> f <~> h bAnother nice thing about this representation is that we have the "identity" isomorphism by using . from Prelude. . :: f  g sAs a convention, most isomorphisms have form "X-ing", where the forwards function is "ing". For example, we have:   ::   t =>  ! t a  t f ( " t f)  # :: Monoidal t => SF t a  t f (MF t f) functor-combinators Create an f  g1 by providing both legs of the isomorphism (the  f a -> g a and the  g a -> f a.functor-combinatorsUse a & by retrieving the "forward" function:  :: (f  ~ g) -> f a -> g a functor-combinatorsUse a ( by retrieving the "backwards" function:  :: (f  ~ g) -> f a -> g a functor-combinatorsLift a function  g a ~> g a to be a function  f a -> f a(, given an isomorphism between the two.One neat thing is that  i id == id.functor-combinatorsReverse an isomorphism.  ( i) ==  i  ( i) ==  i  0(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone&'-.24567=?EHMUVX_fkofunctor-combinatorsAn f a, along with a / index.  f a ~ (/ , f a) Step f ~ ((,) Natural) # f -- functor composition 2It is the fixed point of infinite applications of  (functor sums).Intuitively, in an infinite f :+: f :+: f :+: f ..., you have exactly one f  somewhere. A  f a has that f , with a / giving you "where" the f is in the long chain.!Can be useful for using with the   instance of . 5ing it requires no constraint on the target context.5Note that this type and its instances equivalent to  (0 /).functor-combinatorsA non-empty map of / to f a!. Basically, contains multiple f as, each at a given / index.  Steps f a ~ $% / (f a) Steps f ~ $% / # f -- functor composition )It is the fixed point of applications of &'.5You can think of this as an infinite sparse array of f as.Intuitively, in an infinite &f `TheseT` f `TheseT` f `TheseT` f ...0, each of those infinite positions may have an f; in them. However, because of the at-least-one nature of &'2, we know we have at least one f at one position  somewhere.A  f a has potentially many fs, each stored at a different /0 position, with the guaruntee that at least one f exists.!Can be useful for using with the   instance of &'.ing it requires at least an 1U instance in the target context, since we have to handle potentially more than one f.%This type is essentailly the same as ( (0 /) (except with a different 2 instance).functor-combinators"Uncons and cons" an f branch before a %. This is basically a witness that  and  form an isomorphism.functor-combinatorsPop off the first item in a  . Because a  f is f :+: f :+: f :+: ...+ forever, this matches on the first branch.$You can think of it as reassociating f :+: f :+: f :+: f :+: ... into f :+: ( f :+: f :+: f :+: ...)   ( 2 "hello") -- / (Step 1 "hello") stepDown (Step 0 "hello") --  "hello" Forms an isomorphism with  (see ).functor-combinatorsUnshift an item into a  . Because a  f is f :+: f :+: f :+: f :+: ...> forever, this basically conses an additional possibility of f to the beginning of it all.$You can think of it as reassociating f :+: ( f :+: f :+: f :+: ...) into f :+: f :+: f :+: f :+: ...   ( "hello") --  0 "hello" stepUp (% (Step 1 "hello")) -- Step 2 "hello" Forms an isomorphism with  (see ).functor-combinators)We have a natural transformation between  and any other functor f with no constraints.functor-combinatorsAn f a, along with a   flag  f a ~ (  , f a) Flagged f ~ ((,) Bool) # f -- functor composition Creation with  or , uses 3 as the boolean.You can think of it as an f ao that is "flagged" with a boolean value, and that value can indicuate whether or not it is "pure" (made with  or ,) as 30, or "impure" (made from some other source) as 4 . However, 3C may be always created directly, of course, using the constructor.You can think of it like a  that is either 0 or 1, as well. 5ing it requires no constraint on the target context.6This type is equivalent (along with its instances) to: ) *+ , 5functor-combinators"Uncons and cons" an f branch before a %. This is basically a witness that  and  form an isomorphism.functor-combinatorsPop off the first item in a  . Because a  f is f  f  f  ...+ forever, this matches on the first branch.$You can think of it as reassociating f  f  f  f  ... into f  ( f  f  f  ...)  It returns: if the first item is the only item in the  if the first item in the T is empty, but there are more items left. The extra items are all shfited down. if the first item in the W exists, and there are also more items left. The extra items are all shifted down.Forms an isomorphism with  (see ).functor-combinatorsUnshift an item into a  . Because a  f is f  f  f  f  ...> forever, this basically conses an additional possibility of f to the beginning of it all.$You can think of it as reassociating f  ( f  f  f  ...) into f  f  f  f  ...  If you give:, then it returns a singleton  with one item at index 0), then it shifts every item in the given  up one index.), then it shifts every item in the given 0 up one index, and adds the given item (the f) at index zero.Forms an isomorphism with  (see ).functor-combinatorsLeft-biased untionfunctor-combinatorszAppends the items back-to-back, shifting all of the items in the second map. Matches the behavior as the fixed-point of .+functor-combinators+ a b is uninhabited for all a and b..functor-combinatorsUses 3 for 6./functor-combinatorsUses 3 for ,, and 7 for 8.=functor-combinators= a b is uninhabited for all a and b.>functor-combinatorsIf you treat a + f a as a functor combinator, then > lets you convert from a + f a into a t f a for any functor combinator t.Pfunctor-combinatorsIf you treat a = f a' as a binary functor combinator, then P lets you convert from a = f a into a t f a for any functor combinator t.+=>P+>=P(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNoneSXk/aVfunctor-combinatorsFor any 9 f%, produce a value that would require  f.&Always use with concrete and specific f only, and never use with any f that already has a  instance.See documentation for  - for example usages.The .// argument allows you to specify which specific f7 you want to enhance. You can pass in something like ./ @MyFunctor.Wfunctor-combinatorsFor any " f%, produce a value that would require : f.&Always use with concrete and specific f only, and never use with any f that already has a : instance.See documentation for  - for example usages.The .// argument allows you to specify which specific f7 you want to enhance. You can pass in something like ./ @MyFunctor.Xfunctor-combinatorsFor any % f%, produce a value that would require $ f.&Always use with concrete and specific f only, and never use with any f that already has a $ instance.See documentation for  - for example usages.The .// argument allows you to specify which specific f7 you want to enhance. You can pass in something like ./ @MyFunctor.Yfunctor-combinatorsFor any " f&, produce a value that would require ; f.&Always use with concrete and specific f only, and never use with any f that already has a ; instance.See documentation for  - for example usages.The .// argument allows you to specify which specific f7 you want to enhance. You can pass in something like ./ @MyFunctor.VWXYVWXY0None-.14;<HSUVX_kdg [functor-combinators(Useful newtype to allow us to derive an b instance from any instance of ^, using -XDerivingVia.For example, because we have  instance ^ , we can write: deriving via ([  f) instance b ( f) to give us an automatic b instance and save us some work.^functor-combinatorsA ^ is like an b, but it enhances two) different functors instead of just one.BUsually, it enhaces them "together" in some sort of combining way.This typeclass provides a uniform instance for "swapping out" or "hoisting" the enhanced functors. We can hoist the first one with _, the second one with `!, or both at the same time with a.For example, the f :*: g type gives us "both f and g": data (f  g) a = f a :*: g a It combines both f and gB into a unified structure --- here, it does it by providing both f and g.The single law is: a . id == id This ensures that _, `, and a# do not affect the structure that t( adds on top of the underlying functors._functor-combinators'Swap out the first transformed functor.`functor-combinators(Swap out the second transformed functor.afunctor-combinators4Swap out both transformed functors at the same time.bfunctor-combinatorsAn b can be thought of a unary "functor transformer" --- a basic functor combinator. It takes a functor as input and returns a functor as output._It "enhances" a functor with extra structure (sort of like how a monad transformer enhances a % with extra structure).oAs a uniform inteface, we can "swap the underlying functor" (also sometimes called "hoisting"). This is what c does: it lets us swap out the f in a t f for a t g.For example, the free monad  takes a ! and returns a new !8. In the process, it provides a monadic structure over f. c lets us turn a  f into a  g: a monad built over f' can be turned into a monad built over g.AFor the ability to move in and out of the enhanced functor, see 1 and  .This class is similar to 23 from Control.Monad.Morph$, but instances must work without a % constraint.cfunctor-combinatorsIf we can turn an f into a g, then we can turn a t f into a t g.It must be the case that c . == id  Essentially, t f adds some "extra structure" to f. c must swap out the functor, %without affecting the added structure. For example,  f a is essentially a list of f a s. If we c to swap out the f as for g as, then we must ensure that the "added structure" (here, the number of items in the list, and the ordering of those items) remains the same. So, cQ must preserve the number of items in the list, and must maintain the ordering.The law c . == id' is a way of formalizing this property.<functor-combinators,Isomorphism between different varieities of .=functor-combinators,Isomorphism between different varieities of .dfunctor-combinatorsTurn > into any " f$. Can be useful as an argument to c, a, or  .It is a more general form of 24 from mmorph.efunctor-combinators(Natural transformation from any functor f into 3. Can be useful for "zeroing out" a functor with c or a or  .?functor-combinatorsNote that there is no   or 5 instance, because  requires ! f.@functor-combinatorsNote that there is no   or 5 instance, because  requires ! f. [\]^_a`bc<=de(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone%,-./124567=?@AHSUVX_{ffunctor-combinatorswThe functor combinator that forgets all structure in the input. Ignores the input structure and stores no information.DActs like the "zero" with respect to functor combinator composition.  ProxyF f ~ ProxyF  f ProxyF ~ ProxyF  It can be @ed into (losing all information), but it is impossible to ever   or   it.This is essentially u ().hfunctor-combinatorsLift an isomorphism over an b.Essentailly, if f and g are isomorphic, then so are t f and t g.ufunctor-combinators`Functor combinator that forgets all structure on the input, and instead stores a value of type e.Like f9, acts like a "zero" with functor combinator composition. It can be @ed into (losing all information), but it is impossible to ever   or   it.functor-combinators is effectively a "higher-order %", in the sense that b is a "higher-order !".%It can be considered a typeclass for b.s that you can bind continuations to, nautraluniversal over all fTfunctors. They work "for all functors" you lift, without requiring any constraints.It is very similar to   , except  > has the ability to constrain the contexts to some typeclass.The main law is that binding  should leave things unchanged:   == . But 2 should also be associatiatve, in a way that makes  . hjoin = hjoin . c hjoin That is, squishing a  t (t (t f)) a into a t f aP can be done "inside" first, then "outside", or "outside" first, then "inside".-Note that these laws are different from the  ) laws, so we often have instances where  and  > (though they both may typecheck) produce different behavior.This class is similar to 26 from Control.Monad.Morph$, but instances must work without a % constraint.functor-combinatorsBind a continuation to a t f into some context g.functor-combinatorsCollapse a nested t (t f) into a single t f.functor-combinatorsA typeclass for bs where you can "inject" an f a into a t f a:  :: f a -> t f a If you think of t f a as an "enhanced f", then  allows you to use an f as its enhanced form.?With the exception of directly pattern matching on the result, 8 itself is not too useful in the general case without  0 to allow us to interpret or retrieve back the f.functor-combinators Lift from f into the enhanced t f structure. Analogous to A from B. Note that this lets us "lift" a f a; if you want to lift an a with  a -> t f a , check if t f is an instance of " or ;.functor-combinatorsAn "b combinator" that turns an b- into potentially infinite nestings of that b.An  t f a is either f a, t f a,  t (t f) a, t (t (t f)) a, etc.This effectively turns t into a tree with t branches.&One particularly useful usage is with ^R. For example if you had a data type representing a command line command parser: data Command a 8You could represent "many possible named commands" using type Commands = ^  Command And you can represent multiple nested named commands using: type NestedCommands =  (^ )  This has an  T instance, but it can be more useful to use via direct pattern matching, or through  :: ^ t => f ) g -> t g ~> g -> HFree t f ~> g &which requires no extra constriant on g0, and lets you consider each branch separately.4This can be considered the higher-oder analogue of ; it is the free  for any b t. Note that   is equivalent to .functor-combinatorsAn "b combinator" that enhances an b$ with the ability to hold a single f a). This is the higher-order analogue of .You can think of it as a free  for any f. Note that   is equivalent to  78.functor-combinatorsA higher-level   to get a t f a back out of an  t f a , provided t is an instance of .This witnesses the fact that  is the "Free ".functor-combinatorsRecursively fold down an  into a single g= result, by handling each branch. Can be more useful than  e because it allows you to treat each branch separately, and also does not require any constraint on g.This is the catamorphism on .functor-combinatorsA higher-level   to get a t f a back out of an  t f a , provided t is an instance of $.This witnesses the fact that  is the "Free $".functor-combinators is the "free  and  " for any bfunctor-combinators Only uses Cfunctor-combinators Only uses Cfunctor-combinators Injects with 3.Equivalent to instance for  78 and  .functor-combinators4Injects into a singleton map at 0; same behavior as w (79 :;).functor-combinatorsInjects with 0.Equivalent to instance for  (79 :;).functor-combinators Injects into a singleton map at D.functor-combinators Injects into a singleton map at D.functor-combinators is the "free  " for any bfunctor-combinators'Combines the accumulators, Writer-stylefunctor-combinatorsEquivalent to instance for  78 and  .functor-combinatorsEquivalent to instance for  (79 :;).bcfghuvwbchfguvw (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,-/8=?@AHSUVX_ functor-combinatorsA constraint on a for both c a and d a . Requiring  ( E a is the same as requiring (( a, E a).functor-combinatorsAn + lets us move in and out of the "enhanced" !. For example,  f is f* enhanced with monadic structure. We get:  :: f a ->  f a  :: % m => (forall x. f x -> m x) ->  f a -> m a  will let us use our f inside the enhanced  f.  will let us "extract" the f from a  f if we can give an interpreting function that interprets f into some target %.The type family B tells us the typeclass constraint of the "target" functor. For , it is %, but for other - instances, we might have other constraints.We enforce that:  id .  == id -- or  .  == id That is, if we lift a value into our structure, then immediately interpret it out as itself, it should lave the value unchanged.functor-combinators(The constraint on the target context of I. It's basically the constraint that allows you to "exit" or "run" an .functor-combinators Remove the f out of the enhanced t f structure, provided that fO satisfies the necessary constraints. If it doesn't, it needs to be properly ed out.functor-combinators%Given an "interpeting function" from f to g, interpret the f out of the t f into a final context g.functor-combinators A convenient flipped version of .functor-combinatorsUseful wrapper over + to allow you to directly extract a value b out of the t f a, if you can convert f x into b.@Note that depending on the constraints on the interpretation of t%, you may have extra constraints on b.If  t is F, there are no constraints on bIf  t is :, b needs to be an instance of 2If  t is ", b needs to be an instance of GFor some constraints (like %), this will not be usable. -- get the length of the  Map String in the . 3 length :: Step (Map String) Bool -> Int functor-combinatorsUseful wrapper over  to allow you to collect a b from all instances of f inside a t f a.This will work if  t is F, :, or ". -- get the lengths of all  Map String s in the  . 3 length :: Ap (Map String) Bool -> [Int] functor-combinators Never uses functor-combinators Never uses functor-combinatorsThe only way for this to obey  .  == .- is to have it impossible to retract out of.functor-combinatorsThe only way for this to obey  .  == .- is to have it impossible to retract out of.functor-combinators!This ignores the environment, so  /= functor-combinatorsA free H, but only when applied to a %.functor-combinatorsA free ;functor-combinatorsA free ;functor-combinatorsA free Ffunctor-combinatorsA free "functor-combinatorsA free "functor-combinatorsA free $functor-combinatorsA free %functor-combinators Technically, # is over-constrained: we only need C :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use  here instead, but we never use D. This would only go wrong in situations where your type supports C but not , like instances of <= without >?.functor-combinators Technically, # is over-constrained: we only need C :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use  here instead, but we never use D. This would only go wrong in situations where your type supports C but not , like instances of <= without >?.functor-combinatorsA free 9functor-combinators Technically, # is over-constrained: we only need C :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use  here instead, but we never use D. This would only go wrong in situations where your type supports C but not , like instances of <= without >?.functor-combinatorsEquivalent to instance for  78 and  .functor-combinatorsEquivalent to instance for  (79 :;).functor-combinators Technically, # is over-constrained: we only need C :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use  here instead, but we never use D. This would only go wrong in situations where your type supports C but not , like instances of <= without >?.functor-combinatorsA free 1 functor-combinatorsA free  functor-combinatorsA free " functor-combinatorsA free !(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone%-.124567;<HSUVX_jfunctor-combinatorsAn ^) that ignores its second input. Like a  with no /right branch.This is @A from Data.Bifunctors.Joker2, but given a more sensible name for its purpose.functor-combinatorssLift two isomorphisms on each side of a bifunctor to become an isomorphism between the two bifunctor applications.Basically, if f and f' are isomorphic, and g and g' are isomorphic, then t f g is isomorphic to t f' g'.!functor-combinatorsAn ^( that ignores its first input. Like a  with no  /left branch.In its polykinded form (on f0), it is essentially a higher-order version of BC.[\]^_a`!"#^_a`[\]!"# (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone%&'-.14HSUVX_g;functor-combinators One or more fs convolved with itself. Essentially: ;1 f ~ f -- one f  (f `Day' f) -- two f's :+: (f `Day` f `Day` f) -- three f's :+: (f `Day` f `Day` f `Day` f) -- four f's :+: ... -- etc. !Useful if you want to promote an f$ to a situation with "at least one f sequenced with itself".Mostly useful for its b and - instance, along with its relationship with   and .This is the free : --- Basically a "non-empty"  ."The construction here is based on  , similar to now DE is built on list.=functor-combinatorsAn ; f is just a  f (  f)A. This bidirectional pattern synonym lets you treat it as such.?functor-combinatorsAn ; is a "non-empty"  R; this function "forgets" the non-empty property and turns it back into a normal  .@functor-combinators Convert an   into an ; if possible. If the   was "empty", return the I value instead.Afunctor-combinators Embed an f into ;.Bfunctor-combinators Extract the f out of the ;. B . A == id Cfunctor-combinators Interpret an   f into some : context g. ;=><?@ABC ;=><=?@ABC (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,8=?@ACHSUVXB Jfunctor-combinatorsKA typeclass associating a free structure with the typeclass it is free on.$This essentially lists instances of  where a "trip" through M will leave it unchanged. K . L == id L . K == id This can be useful because MS doesn't have a concrete structure that you can pattern match on and inspect, but tC might. This lets you work on a concrete structure if you desire.Mfunctor-combinators:A simple way to inject/reject into any eventual typeclass./In a way, this is the "ultimate" multi-purpose * instance. You can use this to inject an f7 into a free structure of any typeclass. If you want f to have a %! instance, for example, just use  :: f a -> M % f a 8When you want to eventually interpret out the data, use:  :: (f  g) -> M c f a -> g a  Essentially, M c is the "free c". M % is the free %, etc.M can theoretically replace  , ;, , ,, E, , FG, , and other instances of JM, if you don't care about being able to pattern match on explicit structure.However, it cannot replace / instances that are not free structures, like H, I, JK, etc.*Note that this doesn't have instances for allg the typeclasses you could lift things into; you probably have to define your own if you want to use M c as an instance of c (using P, Q, R for help).Pfunctor-combinatorsLift an action into a M.Qfunctor-combinatorsMap the action in a M.Rfunctor-combinators Merge two M actions.Sfunctor-combinators!Re-interpret the context under a M.Tfunctor-combinatorsFinalize an  instance.  toFinal ::  f  M ! f toFinal ::   f  M " f toFinal :: 1 f  M 9 f toFinal ::  f  M % f toFinal ::  f  M ; f toFinal ::  f  M  f Note that the instance of c for M c must be defined.This operation can potentially forget structure in t. For example, we have: T :: I f ~> M 1 f 8In this process, we lose the "positional" structure of I.In the case where TC doesn't lose any information, this will form an isomorphism with U, and t is known as the "Free c". For such a situation, t will have a J instance.Ufunctor-combinators Concretize a M.Vfunctor-combinators=The isomorphism between a free structure and its encoding as M. JLKMNOPQRSTUV MNOUTJLKVSPQR (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone+%&',-./1245678;<=>?@ACHMPSUVX_fgkoq0functor-combinators1Convenient alias for the constraint required for , , etc.oIt's usually a constraint on the target/result context of interpretation that allows you to "exit" or "run" a  t.functor-combinators For some t3s, you can represent the act of applying a functor f to t< many times, as a single type. That is, there is some type  t f that is equivalent to one of:f a& -- 1 timet f f a# -- 2 times t f (t f f) a -- 3 timest f (t f (t f f)) a -- 4 timest f (t f (t f (t f f))) a -- 5 times.. etcThis typeclass associates each t7 with its "induced semigroupoidal functor combinator"  t.PThis is useful because sometimes you might want to describe a type that can be t f f,  t f (t f f), t f (t f (t f f))2, etc.; "f applied to itself", with at least one f,. This typeclass lets you use a type like ,& in terms of repeated applications of , or ;' in terms of repeated applications of , or ' in terms of repeated applications of , etc. For example, f  f1 can be interpreted as "a free selection of two f's", allowing you to specify "I have to fLs that I can use". If you want to specify "I want 1, 2, or many different f s that I can use", you can use , f.#At the high level, the main way to use a  is with  and :  :: t f f  f ' :: (f ~> h) -> (g ~> h) -> t f g ~> h which are like the ^ versions of  and /: they fully "mix" together the two inputs of t.Also useful is:  :: t f f a -> SF t f a Which converts a t into its aggregate type .In reality, most  instances are also   instances, so you can think of the separation as mostly to help organize functionality. However, there are two non-monoidal semigroupoidal instances of note:  and !+, which are higher order analogues of the 7L and 7M semigroups, roughly.functor-combinators0The "semigroup functor combinator" generated by t.A value of type SF t f a is  equivalent to one of: f a t f f a  t f (t f f) a t f (t f (t f f)) a t f (t f (t f (t f f))) a.. etcFor example, for  , we have ,. This is because: x ~ , (x J []) ~  x x & y ~ NonEmptyF (x :| [y]) ~ : (x :*: y) x :*: y :*: z ~ NonEmptyF (x :| [y,z]) -- etc. 'You can create an "singleton" one with , or else one from a single t f f with .functor-combinatorsIf a  t f% represents multiple applications of t f+ to itself, then we can also "append" two  t f(s applied to themselves into one giant  t f containing all of the t fs.functor-combinatorsPrepend an application of t f to the front of a  t f.functor-combinatorsEmbed a direct application of f to itself into a  t f.functor-combinatorsThe ^ analogy of . It retracts both fs into a single f), effectively fully mixing them together.functor-combinatorsThe ^ analogy of X. It takes two interpreting functions, and mixes them together into a target functor h.functor-combinatorsAn ^/ where it doesn't matter which binds first is K. Knowing this gives us a lot of power to rearrange the internals of our b at will.%For example, for the functor product: data (f  g) a = f a :*: g a  We know that f :*: (g :*: h) is the same as (f :*: g) :*: h.functor-combinatorsThe isomorphism between  t f (t g h) a and  t (t f g) h a!. To use this isomorphism, see  and .functor-combinatorsReassociate an application of t.functor-combinatorsReassociate an application of t.functor-combinatorsAn  t f* represents the successive application of t to f1, over and over again. So, that means that an  t f must either be a single f, or an  t f (SF t f)., states that these two are isomorphic. Use  and   & to convert between one and the other.functor-combinatorsUseful wrapper over + to allow you to directly extract a value b out of the t f a, if you can convert f x into b.@Note that depending on the constraints on the interpretation of t%, you may have extra constraints on b.If  ( t) is NO$, there are no constraints on bIf  ( t) is :, b needs to be an instance of 2If  ( t) is ", b needs to be an instance of GFor some constraints (like %), this will not be usable. Z-- Return the length of either the list, or the Map, depending on which -- one s in the K  L length :: ([] :+: P% M) NO -> Int -- Return the length of both the list and the map, added together  (Q9! . length) (Sum . length) :: " [] (Map Int) Char -> Sum Int functor-combinatorsInfix alias for  Z-- Return the length of either the list, or the Map, depending on which -- one s in the K L  length :: ([] :+: P% M) NO -> Int -- Return the length of both the list and the map, added together Q9" . length !$! Sum . length :: " [] (Map Int) Char -> Sum Int functor-combinatorsInfix alias for functor-combinatorsUseful wrapper over  to allow you to collect a b from all instances of f and g inside a t f g a.This will work if  t is NO, :, or ".functor-combinators Ideally here  would be equivalent to  ", just like for . This should be possible if we can write a bijection. This bijection should be possible in theory --- but it has not yet been implemented.55 (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone'%&',-./14568;<=>?@ACHMPSUVX_fgkoqNQ&functor-combinators For some t2, we have the ability to "statically analyze" the  tf and pattern match and manipulate the structure without ever interpreting or retracting. These are .functor-combinatorsThe inverse of . A consing of f to  t f/ is non-empty, so it can be represented as an  t f. This is analogous to a function O (J) :: (a, [a]) -> P a.functor-combinators"Pattern match" on an  t f<: it is either empty, or it is non-empty (and so can be an  t f).This is analgous to a function DR :: [a] -> Maybe (P a).Note that because tM cannot be inferred from the input or output type, you should use this with -XTypeApplications:  @ ::   f a -> (> :+: ; f) a functor-combinators1Convenient alias for the constraint required for , , , etc.oIt's usually a constraint on the target/result context of interpretation that allows you to "exit" or "run" a  t.functor-combinatorsA  t is a !, in that it provides some type  t f that is equivalent to one of:I a' -- 0 timesf a& -- 1 timet f f a# -- 2 times t f (t f f) a -- 3 timest f (t f (t f f)) a -- 4 timest f (t f (t f (t f f))) a -- 5 times.. etcThe difference is that unlike  t,  t has the "zero times" value.(This typeclass lets you use a type like ' in terms of repeated applications of , or  ' in terms of repeated applications of , or & in terms of repeated applications of , etc. For example, f  f1 can be interpreted as "a free selection of two f's", allowing you to specify "I have to fLs that I can use". If you want to specify "I want 0, 1, or many different f s that I can use", you can use  f."At the high level, the thing that  adds to  is , , and :  :: f a -> t f g a  :: g a -> t f g a  :: I a -> MF t f a which are like the ^ versions of : it lets you inject an f into t f g=, so you can start doing useful mixing operations with it.  lets you construct an "empty"  t.Also useful is:  :: t f f a -> MF t f a Which converts a t into its aggregate type functor-combinators-The "monoidal functor combinator" induced by t.A value of type MF t f a is  equivalent to one of:I a# -- zero fsf a! -- one ft f f a -- two fs t f (t f f) a -- three fs t f (t f (t f f)) a t f (t f (t f (t f f))) a.. etcFor example, for  , we have . This is because:  ~  [] ~  @(%) x ~ ListF [x] ~ & x x :*: y ~ ListF [x,y] ~ 1 (x :*: y) x :*: y :*: z ~ ListF [x,y,z] -- etc. #You can create an "empty" one with , a "singleton" one with , or else one from a single t f f with .functor-combinatorsIf a  t f% represents multiple applications of t f+ to itself, then we can also "append" two  t f(s applied to themselves into one giant  t f containing all of the t fs.functor-combinatorsLets you convert an  t f into a single application of f to  t f.Analogous to a function P a -> (a, [a])<Note that this is not reversible in general unless we have  t.functor-combinatorsAn  t f- is either empty, or a single application of t to f and MF t f< (the "head" and "tail"). This witnesses that isomorphism.To use this property, see , , and .functor-combinatorsEmbed a direct application of f to itself into a  t f.functor-combinators t f is "one or more fs", and 'MF t f is "zero or more f9s". This function lets us convert from one to the other. This is analogous to a function P a -> [a].Note that because tN is not inferrable from the input or output type, you should call this using -XTypeApplications:  @() :: , f a ->  f a fromSF @ ::  f a ->  f a functor-combinatorsIf we have an  t, we can generate an f! based on how it interacts with t.+Specialized (and simplified), this type is:  @ :: " f => > a -> f a -- , pureT @ :: %" f => Identity a -> f a -- & pureT @() ::  f =>  a -> f a -- C Note that because tv appears nowhere in the input or output types, you must always use this with explicit type application syntax (like  pureT @Day)functor-combinatorsIf we have a constraint on the 8 satisfied, it should also imply the constraint on the .This is basically saying that  ( t) should be a superclass of  ( t).For example, for  , this type signature says that 1 is a superclass of , so whenever you have , you should always also have 1.For  , this type signature says that : is a superclass of ", so whenever you have ", you should always also have :.:This is necessary because in the current class hierarchy, : isn't a true superclass of ".  basically "imbues" f with an : instance based on its "+ instance, so things can be easier to use.%For example, let's say I have a type Parser that is an "6 instance, but the source library does not define an : instance. I cannot use  or A with it, even though I should be able to, because they require :.That is:  ::  Parser Parser a -> Parser a %is a type error, because it requires : Parser.But, if we know that Parser has an " instance, we can use:  @ ( @Parser)  :: Day Parser Parser a -> a %and this will now typecheck properly. Ideally, Parser would also have an :G instance. But we cannot control this if an external library defines Parser. (Alternatively you can just use .)&Note that you should only use this if f doesn't already have the Y constraint. If it does, this could lead to conflicting instances. Only use this with specific , concrete fJs. Otherwise this is unsafe and can possibly break coherence guarantees.The proxy/ argument can be provided using something like  @f, to specify which f you want to upgrade.functor-combinatorsAn  ^ can be a  if there is some identity i where t i f is equivalent to just f.That is, "enhancing" f with t i does nothing.BThe methods in this class provide us useful ways of navigating a  t with respect to this property.The  is essentially the ^ equivalent of , with  and  taking the place of .functor-combinatorsThe identity of  t. If you "combine" f with the identity, it leaves f unchanged.For example, the identity of  is . This is because ( :*: f) a is equivalent to just f a -ing f with # gives you no additional structure.Another example: (  f) a is equivalent to just f a  because the  case is unconstructable.functor-combinatorsBecause  t f (I t) is equivalent to f, we can always "insert" f into  t f (I t).This is analogous to  from  , but for ^s.functor-combinatorsBecause  t (I t) g is equivalent to f, we can always "insert" g into  t (I t) g.This is analogous to  from  , but for ^s.functor-combinatorsWitnesses the property that  t is the identity of t:  t f (I t) always leaves f, unchanged, so we can always just drop the  t.functor-combinatorsWitnesses the property that  t is the identity of t:  t (I t) g always leaves g, unchanged, so we can always just drop the  t.functor-combinatorsf is isomorphic to t f ( t) : that is,  t is the identity of t , and leaves f unchanged.functor-combinatorsg is isomorphic to t ( t) g : that is,  t is the identity of t , and leaves g unchanged.functor-combinators ( and ) for  actually does not require !$. This is the more general version.functor-combinators ( and ) for  actually does not require !$. This is the more general version.functor-combinators ( and ) for  actually does not require !$. This is the more general version.functor-combinators ( and ) for  actually does not require !$. This is the more general version.functor-combinators for  actually does not require !%. This is the more general version.functor-combinators for  actually does not require !%. This is the more general version.functor-combinatorsCreate the "empty @.If  t f% represents multiple applications of t f with itself, then nilMF gives us "zero applications of f". Note that t6 cannot be inferred from the input or output type of A, so this function must always be called with -XTypeApplications:  @ :: >    f nilMF @ :: Identity ~>  f nilMF @() ::  ~>  f functor-combinators!Lets us "cons" an application of f to the front of an  t f.functor-combinators"Pattern match" on an  tAn  t f- is either empty, or a single application of t to f and MF t f (the "head" and "tail")"This is analogous to the function ST :: [a] -> Maybe (a, [a]).functor-combinatorsConvenient wrapper over . that lets us introduce an arbitrary functor g to the right of an f.You can think of this as an ^ analogue of .functor-combinatorsConvenient wrapper over . that lets us introduce an arbitrary functor f to the right of a g.You can think of this as an ^ analogue of .functor-combinatorsConvenient wrapper over . that lets us drop one of the arguments of a > for free, without requiring any extra constraints (like for ).See % for a version that does not require ! f, specifically for .functor-combinatorsConvenient wrapper over . that lets us drop one of the arguments of a 8 for free, without requiring any constraints (like for ).See % for a version that does not require ! g, specifically for .functor-combinatorsThis is , but taking a  ( t) constraint instead of a  ( t) constraint. For example, for , it takes an " constraint instead of an : constraint.@In an ideal world, this would be not necessary, and we can use . However, sometimes  ( t) is not an actual subclass of  ( t) (like : and "3), even though it should technically always be so.&Note that you should only use this if f doesn't already have the  constraint (for example, for , if f already has an :I instance). If it does, this could lead to conflicting instances. If f already has the  instance, just use  directly. Only use this with specific , concrete fs.functor-combinatorsThis is , but taking a  ( t) constraint instead of a  ( t) constraint. For example, for , it takes an " constraint instead of an : constraint.@In an ideal world, this would be not necessary, and we can use . However, sometimes  ( t) is not an actual subclass of  ( t) (like : and "3), even though it should technically always be so.&Note that you should only use this if f doesn't already have the  constraint (for example, for , if f already has an :I instance). If it does, this could lead to conflicting instances. If f already has the  instance, just use  directly. Only use this with specific , concrete fs.functor-combinatorsAn  t f is isomorphic to an f consed with an  t f, like how a P a is isomorphic to (a, [a]).functor-combinatorsAn  t f) is isomorphic to either the empty case ( t) or the non-empty case ( t f ), like how [a] is isomorphic to  (P a).&&(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-./14567HSUVX_kfunctor-combinators9A useful construction that works like a "linked list" of t f: applied to itself multiple times. That is, it contains t f f,  t f (t f f), t f (t f (t f f)) , etc, with f occuring  zero or more( times. It is meant to be the same as  t.If t is I, then it means we can "collapse" this linked list into some final type  t (1), and also extract it back into a linked list ().So, a value of type  t ( t) f a is one of either:  t a f a t f f a  t f (t f f) a t f (t f (t f f)) a.. etc.Note that this is exactly what an  t is supposed to be. Using  allows us to work with all  tJs in a uniform way, with normal pattern matching and normal constructors."This construction is inspired by 6http://oleg.fi/gists/posts/2018-02-21-single-free.htmlfunctor-combinatorsCA useful construction that works like a "non-empty linked list" of t f9 applied to itself multiple times. That is, it contains t f f,  t f (t f f), t f (t f (t f f)) , etc, with f occuring  one or more( times. It is meant to be the same as  t.A  t f a is explicitly one of: f a t f f a  t f (t f f) a t f (t f (t f f)) a.. etc-Note that this is exactly the description of  t1. And that's "the point": for all instances of ,  t is isomorphic to  t (witnessed by ). That's big picture of Q: it's supposed to be a type that consists of all possible self-applications of f to t." gives you a way to work with all  t in a uniform way. Unlike for  t f= in general, you can always explicitly /pattern match/ on a L (with its two constructors) and do what you please with it. You can also  construct * using normal constructors and functions.You can convert in between  t f and  t f with  and .See ) for a version that has an "empty" value.8This construction is inspired by iteratees and machines.functor-combinatorsRecursively fold down a 4. Provide a function on how to handle the "single f case" (#), and how to handle the "combined t f g& case", and this will fold the entire  t f into a single g.This is a catamorphism.functor-combinatorsRecursively build up a 5. Provide a function that takes some starting seed g and returns either "done" (f) or "continue further" (t f g), and it will create a  t f from a g.This is an anamorphism.functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. The type  t fE is an actual concrete ADT that contains successive applications of t5 to itself, and you can pattern match on each layer.1 states that the two types are isormorphic. Use  and  to convert between the two.functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. M makes that successive application explicit, buy converting it to a literal  of applications of t to itself.  =   functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself.  takes an explicit  of applications of t( to itself and rolls it back up into an  t.  =    functor-combinatorsRecursively fold down a 4. Provide a function on how to handle the "single f case" (#), and how to handle the "combined t f g' case", and this will fold the entire  t i) f into a single g.This is a catamorphism.functor-combinatorsRecursively build up a 5. Provide a function that takes some starting seed g and returns either "done" (i) or "continue further" (t f g), and it will create a  t i f from a g.This is an anamorphism.functor-combinatorsA  is "one or more linked f s", and a  is "zero or more linked fs". So, we can convert from a  to a  that always has at least one f.0The result of this function always is made with  at the top level.functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. The type  t ( t) fE is an actual concrete ADT that contains successive applications of t5 to itself, and you can pattern match on each layer.1 states that the two types are isormorphic. Use  and  to convert between the two.functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. M makes that successive application explicit, buy converting it to a literal  of applications of t to itself.  =   functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself.  takes an explicit  of applications of t( to itself and rolls it back up into an  t.  =    Because tI cannot be inferred from the input or output, you should call this with -XTypeApplications:  @U ::  Comp FG f a ->  f a functor-combinatorsA  t f$ is like a non-empty linked list of f s, and a  t ( t) f$ is a possibly-empty linked list of f>s. This witnesses the fact that the former is isomorphic to f consed to the latter.functor-combinators$The "forward" function representing E. Provided here as a separate function because it does not require ! f.functor-combinatorsA  t ( t) f is a linked list of f s, and a  t f is a non-empty linked list of f$s. This witnesses the fact that a  t (I t) f is either empty ( t) or non-empty ( t f).functor-combinators$The "reverse" function representing E. Provided here as a separate function because it does not require ! f.functor-combinators!We can collapse and interpret an  t i if we have  t.functor-combinatorshandle functor-combinatorshandle functor-combinatorsHandle functor-combinatorsHandle (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNoneV  ,-HI.EFG^_`wxy+^_a`bcdefguvw!"#;<=>JLKMNOϔbc^_a` ,-HI.HEFG^_`wxy ;<=>= fguvw +MNOJLK!"#deQVWXVWYVWZVW[VW\VWZ]]^*+^*+^*_`ab`cdefgefgehiehijkljkmjkm^no^no^npqrst&ut&vt&wt&u^xyzz{|}~((UU      !"#$%&'()*+,-./01223456789:HH;<=>?@ABCDEFGHIIIJKLMNOPQRSTUVWXYZ[\]^__`abcdefghijklmnopqrstuvwxyz{|}~0000000000401)      !"#$%& '  (   ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M NOOPQRSTUVWXYZ[\]^_`aabcdefghijklmnopqrstuvwxy z z { | } ~    K                                                                    !                                          "  #     -                                            !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNV./VOPVQRLSTVQUVWXVWYVOZVO[VW\L]5VO^VO_VO`VabVcd`ef`egVOhVOiVOjVk;Vl9LSdVOmVWnVWoVl8pqrVstVOuVOvL]wpqx0y0zVFG0{0|^}~^}LMVOVsNOVO`aVOVVVWVWVVOE#functor-combinators-0.1.0.1-inplaceData.Functor.CombinatorControl.Natural.IsoFControl.Applicative.ListFControl.Monad.Freer.ChurchControl.Applicative.StepData.Functor.Combinator.UnsafeData.HBifunctor Data.HFunctorData.HFunctor.InterpretData.Functor.Apply.FreeData.HFunctor.FinalData.HBifunctor.AssociativeData.HBifunctor.TensorData.HFunctor.ChainControl.Comonad.Trans.EnvEnvTData.Functor.Tensor HBifunctorMonoidalData.Functor.ComposeComposeData.Functor.HFunctorinject interpretControl.Monad.FreeFreeControl.Monad.Free.ChurchFHFunctor Interpretretract splittingSFSFMFsplitSFMMapData.Functor.TheseTheseTNEMapFHLiftControl.Monad.Trans.Identity IdentityTControl.COmonad.Trans.EnvupgradeC Data.ProxyProxyData.HFunctor.InternalInjectControl.Monad.MorphMFunctor generalizeBindMMonadData.SemigroupAnySumNumeric.NaturalNaturalControl.Monad.Fail MonadFail Control.Monad MonadPlusData.Bifunctors.JokerJoker Data.TaggedTaggedData.List.NonEmptyNonEmptyData.Functor.IdentityIdentityStepStepsControl.Applicative.Backwards BackwardsFirstLastData.Constraint.Trivial UnconstrainedData.Map Data.MonoidnonEmpty Data.ListunconsCompbase GHC.GenericsV1:+::*:R1L1Ncomonad-5.0.5-c5bf5cad68837043f9893cc75a988e158f768c37fe10164e54db90e3f1a56a70transformers-0.5.5.0 runIdentityTKfree-5.1.1-c1620731f5245e30210ec2d402dde407dd92cc1bdd65b5a1b77355abf35f388cControl.Applicative.FreeApControl.Alternative.FreeAltSkan-extensions-5.2-a50a2bb0957787b50e48aa51a5a59a44050fdf131b4eb193d0560e3a108fbb86Data.Functor.CoyonedaCoyonedaData.Functor.DayDayMmmorph-1.1.3-82c4a496f5217866c5a33f189ba771df5a504426080d9275f59a7c706cd5f239Control.Monad.Trans.Compose getComposeTComposeTControl.Monad.Trans.ReaderReaderT runReaderT[natural-transformation-0.4-83f7b3f47c3265a61b74d31e8888a020832ceaf253f484695603f0501af66d8bControl.Natural~>Hthese-1-ed6adc96a1e4af84773ef94db76f2cbbb426db66bd137e768fb5911c7da90367These1That1This1Control.Applicative.LiftLiftListFrunListF $fShowListF $fReadListF $fEqListF $fOrdListF$fFunctorListF$fFoldableListF$fTraversableListF$fGenericListF $fDataListF $fShow1ListF $fRead1ListF $fEq1ListF NonEmptyF runNonEmptyFmapListF$fPointedListF $fMonoidListF$fSemigroupListF$fAlternativeListF $fPlusListF $fAltListF$fApplicativeListF $fApplyListF $fOrd1ListF$fShowNonEmptyF$fReadNonEmptyF $fEqNonEmptyF$fOrdNonEmptyF$fFunctorNonEmptyF$fFoldableNonEmptyF$fTraversableNonEmptyF$fGenericNonEmptyF$fDataNonEmptyF$fShow1NonEmptyF$fRead1NonEmptyF$fEq1NonEmptyFMaybeF runMaybeF ProdNonEmpty nonEmptyProd mapNonEmptyFtoListF fromListF$fPointedNonEmptyF$fSemigroupNonEmptyF$fAltNonEmptyF$fApplicativeNonEmptyF$fOrd1NonEmptyF $fShowMaybeF $fReadMaybeF $fEqMaybeF $fOrdMaybeF$fFunctorMaybeF$fFoldableMaybeF$fTraversableMaybeF$fGenericMaybeF $fDataMaybeF $fShow1MaybeF $fRead1MaybeF $fEq1MaybeFMapFrunMapF mapMaybeF maybeToListF listToMaybeF$fPointedMaybeF$fMonoidMaybeF$fSemigroupMaybeF$fAlternativeMaybeF $fPlusMaybeF $fAltMaybeF$fApplicativeMaybeF $fOrd1MaybeF $fShowMapF $fReadMapF$fEqMapF $fOrdMapF $fFunctorMapF$fFoldableMapF$fTraversableMapF $fGenericMapF $fDataMapF $fShow1MapF $fEq1MapF runNEMapF $fPointedMapF $fPlusMapF $fAltMapF $fMonoidMapF$fSemigroupMapF $fRead1MapF $fOrd1MapF $fShowNEMapF $fReadNEMapF $fEqNEMapF $fOrdNEMapF$fFunctorNEMapF$fFoldableNEMapF$fTraversableNEMapF$fGenericNEMapF $fDataNEMapF $fShow1NEMapF $fEq1NEMapF$fPointedNEMapF $fAltNEMapF$fSemigroupNEMapF$fTraversable1NEMapF$fFoldable1NEMapF $fRead1NEMapF $fOrd1NEMapF:>>=Free1runFree1runFreeunCompMoreF1DoneF1reFreeliftFree interpretFree retractFree hoistFree foldFree' foldFreeCfoldFreereFree1toFree hoistFree1 free1Comp liftFree1 retractFree1interpretFree1 matchFree1 foldFree1' foldFree1C foldFree1comp $fReadFree $fRead1Free $fShowFree $fShow1Free $fOrdFree$fEqFree $fOrd1Free $fEq1Free$fTraversableFree$fFoldableFree$fMonadFreefFree $fMonadFree $fBindFree $fPointedFree$fApplicativeFree $fApplyFree $fFunctorFree $fReadFree1 $fRead1Free1 $fShowFree1 $fShow1Free1 $fOrdFree1 $fEqFree1 $fOrd1Free1 $fEq1Free1$fTraversable1Free1$fFoldable1Free1$fTraversableFree1$fFoldableFree1 $fBindFree1 $fApplyFree1$fFunctorFree1 $fOrdComp$fEqComp $fOrd1Comp $fEq1Comp $fReadComp $fRead1Comp $fShowComp $fShow1Comp$fAlternativeComp$fTraversableComp$fFoldableComp$fApplicativeComp $fFunctorCompExchange<~>isoFviewFreviewFoverFfromF$fProfunctorExchange$fFunctorExchangestepPosstepVal $fShowStep $fReadStep$fEqStep $fOrdStep $fFunctorStep$fFoldableStep$fTraversableStep $fGenericStep $fDataStep $fShow1Step $fRead1Step $fEq1StepgetStepssteppingstepDownstepUpabsurd1$fTraversable1Step$fFoldable1Step $fPointedStep$fApplicativeStep $fOrd1Step $fShowSteps $fReadSteps $fEqSteps $fOrdSteps$fFunctorSteps$fFoldableSteps$fTraversableSteps$fGenericSteps $fDataSteps $fShow1Steps $fRead1Steps $fEq1StepsFlagged flaggedFlag flaggedVal steppings stepsDownstepsUp$fPointedSteps $fAltSteps$fSemigroupSteps$fTraversable1Steps$fFoldable1Steps $fOrd1Steps $fShowFlagged $fReadFlagged $fEqFlagged $fOrdFlagged$fFunctorFlagged$fFoldableFlagged$fTraversableFlagged$fGenericFlagged $fDataFlagged$fShow1Flagged$fRead1Flagged $fEq1FlaggedVoid2$fTraversable1Flagged$fFoldable1Flagged$fPointedFlagged$fApplicativeFlagged $fOrd1Flagged $fShowVoid2 $fReadVoid2 $fEqVoid2 $fOrdVoid2$fFunctorVoid2$fFoldableVoid2$fTraversableVoid2$fGenericVoid2 $fDataVoid2 $fShow1Void2 $fRead1Void2 $fEq1Void2Void3absurd2 $fApplyVoid2 $fBindVoid2 $fAltVoid2$fSemigroupVoid2 $fOrd1Void2 $fShowVoid3 $fReadVoid3 $fEqVoid3 $fOrdVoid3$fFunctorVoid3$fFoldableVoid3$fTraversableVoid3$fGenericVoid3 $fDataVoid3 $fShow1Void3 $fRead1Void3 $fEq1Void3absurd3 $fApplyVoid3 $fBindVoid3 $fAltVoid3$fSemigroupVoid3 $fOrd1Void3 unsafePlus unsafeApply unsafeBind unsafePointed$fPointedPointMeWrappedHBifunctorWrapHBifunctorunwrapHBifunctorhlefthrighthbimaphmapabsorbProxyF overHFunctor $fShowProxyF $fReadProxyF $fEqProxyF $fOrdProxyF$fFunctorProxyF$fFoldableProxyF$fTraversableProxyF$fGenericProxyF $fDataProxyF $fShow1ProxyF $fRead1ProxyF $fEq1ProxyFConstF getConstF$fHFunctorkkProxyF $fOrd1ProxyF $fShowConstF $fReadConstF $fEqConstF $fOrdConstF$fFunctorConstF$fFoldableConstF$fTraversableConstF$fGenericConstF $fDataConstF $fShow1ConstF $fRead1ConstF $fEq1ConstFHBindhbindhjoinHFreeHReturnHJoinHPureHOther retractHLift foldHFree retractHFree$fHFunctorkkConstF $fOrd1ConstF$fHFunctorkkHLift $fOrd1HLift $fEq1HLift $fShow1HLift$fHFunctorkkHFree $fShowHFree $fShow1HFree$fInjectkHFree$fInjectkHLift$fInjectTYPEComposeT$fInjectkConstF$fInjectkProxyF$fInjectkReverse$fInjectTYPEEnvT$fInjectkReaderT$fInjectTYPEWrappedApplicative$fInjectkBackwards$fInjectTYPEMaybeApply$fInjectTYPELift$fInjectkIdentityT$fInjectTYPEAp$fInjectTYPEAp0$fInjectTYPEFree1$fInjectTYPEFree$fInjectTYPEAlt $fInjectkM1 $fInjectkSum $fInjectk:+:$fInjectTYPEProduct$fInjectTYPE:*: $fInjectk:.:$fInjectTYPEComp$fInjectTYPEThese1$fInjectkFlagged$fInjectkSteps $fInjectkStep$fInjectTYPEMapF$fInjectTYPENEMapF$fInjectTYPEMaybeF$fInjectTYPENonEmptyF$fInjectTYPEListF$fInjectTYPEAp1$fInjectTYPECoyoneda $fHBindkHFree $fHBindkHLift$fHBindTYPEEnvT$fHBindkProxyF$fHBindkReverse$fHBindTYPEWrappedApplicative$fHBindkBackwards$fHBindTYPEMaybeApply$fHBindTYPELift$fHBindkIdentityT $fHBindTYPEAp$fHBindTYPEAp0$fHBindTYPEFree1$fHBindTYPEFree$fHBindTYPEAlt $fHBindkM1 $fHBindkSum $fHBindk:+:$fHBindTYPEProduct$fHBindTYPE:*:$fHBindTYPEThese1$fHBindkFlagged $fHBindkStep$fHBindTYPEMaybeF$fHBindTYPENonEmptyF$fHBindTYPEListF$fHBindTYPEAp1$fHBindTYPECoyoneda$fFunctorHLift$fFunctorHFree $fOrdHLift $fEqHLift $fReadHLift $fShowHLiftAndCCforIgetIcollectI$fInterpretHFree$fInterpretHLift$fInterpretConstF$fInterpretProxyF$fInterpretReverse$fInterpretEnvT$fInterpretReaderT$fInterpretWrappedApplicative$fInterpretBackwards$fInterpretMaybeApply$fInterpretLift$fInterpretIdentityT $fInterpretAp$fInterpretAp0$fInterpretFree1$fInterpretFree $fInterpretM1$fInterpretSum$fInterpret:+:$fInterpretProduct$fInterpret:*:$fInterpretAlt$fInterpretThese1$fInterpretFlagged$fInterpretSteps$fInterpretStep$fInterpretNEMapF$fInterpretMapF$fInterpretMaybeF$fInterpretNonEmptyF$fInterpretListF$fInterpretAp1$fInterpretCoyoneda$fInterpretComposeT $fAndCkcdaLeftFrunLeftFoverHBifunctor $fShowLeftF $fReadLeftF $fEqLeftF $fOrdLeftF$fFunctorLeftF$fFoldableLeftF$fTraversableLeftF$fGenericLeftF $fDataLeftF $fShow1LeftF $fRead1LeftF $fEq1LeftF $fOrd1LeftF$fBifunctorLeftF$fBifoldableLeftFRightF runRightF$fHBifunctorkkkLeftF$fBiapplicativeLeftF$fBitraversableLeftF $fShowRightF $fReadRightF $fEqRightF $fOrdRightF$fFunctorRightF$fFoldableRightF$fTraversableRightF$fGenericRightF $fDataRightF$fHFunctorLeftF $fShow1RightF $fRead1RightF $fEq1RightF$fInterpretRightF$fHBindkRightF$fInjectkRightF$fHFunctorkkRightF$fHBifunctorkkkRightF $fOrd1RightF$fHFunctorRightFAp1DayAp1ap1DaytoApfromApliftAp1 retractAp1runAp1$fHFunctorTYPETYPEAp1 $fApplyAp1 $fFunctorAp1FreeOffromFreeFinalrunFinal liftFinal0 liftFinal1 liftFinal2 hoistFinalCtoFinal fromFinal finalizing$fInterpretFinal$fInjectTYPEFinal$fHFunctorTYPETYPEFinal $fPlusFinal $fAltFinal$fFunctorFinal $fAltFinal0$fFunctorFinal0$fMonadReaderrFinal $fMonadFinal $fApplyFinal$fApplicativeFinal$fFunctorFinal1$fPointedFinal$fMonadPlusFinal$fAlternativeFinal $fMonadFinal0$fApplicativeFinal0$fFunctorFinal2 $fMonadFinal1$fApplicativeFinal1 $fApplyFinal0$fFunctorFinal3$fAlternativeFinal0$fApplicativeFinal2 $fApplyFinal1$fFunctorFinal4$fApplicativeFinal3 $fApplyFinal2$fFunctorFinal5 $fBindFinal $fApplyFinal3$fFunctorFinal6 $fApplyFinal4$fFunctorFinal7$fFunctorFinal8$fFreeOfUnconstrainedIdentityT$fFreeOfPlusListF$fFreeOfAltNonEmptyF$fFreeOfPointedMaybeApply$fFreeOfPointedLift$fFreeOfBindFree1$fFreeOfMonadFree$fFreeOfAlternativeAlt$fFreeOfApplicativeAp$fFreeOfApplyAp1$fFreeOfApplicativeAp0$fFreeOfFunctorCoyonedaCSSemigroupoidalappendSFmatchSFconsSFtoSF biretract binterpret Associative associatingassocdisassoc matchingSFbiget!$!!*! bicollect$fAssociativeRightF$fAssociativeLeftF$fAssociativeJoker$fAssociativeComp$fAssociativeVoid3$fAssociativeThese1$fAssociativeSum$fAssociative:+:$fAssociativeDay$fAssociativeProduct$fAssociative:*:$fSemigroupoidalRightF$fSemigroupoidalLeftF$fSemigroupoidalJoker$fSemigroupoidalComp$fSemigroupoidalThese1$fSemigroupoidalSum$fSemigroupoidal:+:$fSemigroupoidalDay$fSemigroupoidalProduct$fSemigroupoidal:*: Matchable unsplitSFmatchMFCMappendMF splittingMFtoMFfromSFpureTTensorIintro1intro2elim1elim2 rightIdentity leftIdentitysumLeftIdentitysumRightIdentityprodLeftIdentityprodRightIdentityprodOutLprodOutRnilMFconsMFunconsMFinLinRoutLoutR biretractT binterpretT matchingMF $fTensorComp$fTensorThese1 $fTensorSum $fTensor:+: $fTensorDay$fTensorProduct $fTensor:*:$fMonoidalComp$fMonoidalThese1 $fMonoidalSum $fMonoidal:+: $fMonoidalDay$fMonoidalProduct $fMonoidal:*:$fMatchableSum$fMatchable:+:$fMatchableDay$fMatchableProduct$fMatchable:*:ChainDoneMoreChain1Done1More1 foldChain1 unfoldChain1 unrollingSFunrollSFrerollSF foldChain unfoldChain fromChain1 unrollingMFunrollMFrerollMFsplittingChain1 splitChain1 matchingChain unmatchChain$fInterpretChain1$fInjectkChain1$fHFunctorkkChain1 $fRead1Chain1 $fShow1Chain1 $fOrd1Chain1 $fEq1Chain1$fInterpretChain$fInjectTYPEChain$fHFunctorkkChain $fRead1Chain $fShow1Chain $fOrd1Chain $fEq1Chain$fGenericChain1$fTraversableChain$fFoldableChain$fFunctorChain $fReadChain $fShowChain $fOrdChain $fEqChain$fTraversableChain1$fFoldableChain1$fFunctorChain1 $fReadChain1 $fShowChain1 $fOrdChain1 $fEqChain1Tsemigroupoids-5.3.2-e1093a5046408d74b5e506f1ef12e85d0aa6d6af6e9af478e36f7ae4f30acbc4Data.Functor.PlusPlusGHC.BaseString GHC.MaybeJustData.Functor.AltMaybeghc-prim GHC.TypesIOBoolFunctor Applicative:.:Data.Functor.Bind.ClassMonadreturn>>=GHC.ShowShowGHC.ReadReadControl.Monad.Free.Classwrap MonadFreepure.id GHC.NaturalData.Semigroup.Internal SemigroupFalseTrueNpointed-5.0.1-8acb0c645b13245808034af7316e98e4672192b7df00627d04b7f7587ee0eb3d Data.Pointedpoint GHC.Classes||<*> AlternativeApplyPointedsumSumprodProd$fHFunctorTYPETYPEMaybeT$fHFunctorTYPETYPEFControl.Monad.Trans.Classlift MonadTranszeromemptyEq[trivial-constraint-0.5.1.0-b5429918ea27db68d28e05400458a72bba8ce6200c89fd0033f82307a012c1c3Monoid mtl-2.2.2Control.Monad.Reader.Class MonadReaderPure:|GHC.Num+ Data.FoldablelengthIntChar Data.Tupleuncurry