!~1#      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU 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 { | } ~                                                                                                                                                                 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 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 { | } ~                                                                          ! " # $ %&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqfunctor-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 0 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 0 that doesn't require & fF, by taking a RankN folding function. This is essentially a flipped $./functor-combinators A version of 0 that doesn't require & f, by folding over a  instead.0functor-combinatorsRecursively fold down a " by handling the 1# case and the nested/wrapped case.This is a catamorphism.This requires & f; see . and /% for a version that doesn't require & f.1functor-combinators Convert a  f into any instance of 0 f.2functor-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 4? for a version that preserves the "one nested layer" property.3functor-combinators#Map the underlying functor under a .4functor-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.5functor-combinators Inject an f into a  f6functor-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.7functor-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.8functor-combinatorsA  f is either a single un-nested f, or a f nested with another  f". This decides which is the case.9functor-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 1 and /.?functor-combinatorsShow in terms of 1 and /.Nfunctor-combinatorsRead in terms of ( and '.Pfunctor-combinatorsShow in terms of ( and './functor-combinatorshandle 1functor-combinatorshandle /0functor-combinatorshandle 1functor-combinatorshandle /;functor-combinatorshandle (.functor-combinatorshandle '. %&(' !"#$)*+,-./0123456789:;<#"#$)*+,-0./(' !('12576348;9:%&%<(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqjfunctor-combinators2The type of an isomorphism between two functors. f j g means that f and g are isomorphic to each other.We can effectively use an f <~> g with: m :: (f <~> g) -> f a -> g a n :: (f <~> g) -> g a -> a a Use m to extract the "f to g" function, and n 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 2 from Prelude: (2+) :: f <~> g -> g <~> h -> f <~> h bAnother nice thing about this representation is that we have the "identity" isomorphism by using 3 from Prelude. 3 :: f j g sAs a convention, most isomorphisms have form "X-ing", where the forwards function is "ing". For example, we have: ' ::  t => ( t a j t f () t f) * :: Monoidal t => SF t a  t f (MF t f) kfunctor-combinators Create an f j g1 by providing both legs of the isomorphism (the  f a -> g a and the  g a -> f a.mfunctor-combinatorsUse a j& by retrieving the "forward" function: m :: (f  ~ g) -> f a -> g a nfunctor-combinatorsUse a j( by retrieving the "backwards" function: m :: (f  ~ g) -> f a -> g a ofunctor-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 o i id == id.pfunctor-combinatorsReverse an isomorphism. m (p i) == n i n (p i) == m i jklmnopjklmnopj0(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;=>?@ACEHMPSUVX_fgkqZ qfunctor-combinatorsWrap a 4 to be used as a member of ttfunctor-combinatorsThe contravariant analogue of 5 ; it is 4 without 6.If one thinks of f a as a consumer of as, then ux allows one to handle the consumption of a value by splitting it between two consumers that consume separate parts of a.ud takes the "splitting" method and the two sub-consumers, and returns the wrapped/combined consumer.All instances of 4 should be instances of t with u = 7.2The guarantee that a function polymorphic over of t f provides that 4 f doesn't that any input consumed will be passed to at least one sub-consumer; it won't potentially disappear into the void, as is possible if 6 is available./Mathematically, a functor being an instance of t means that it is "semgroupoidal" with respect to the contravariant (tupling) Day convolution. That is, it is possible to define a function (f Day f) a -> f a in a way that is associative.ufunctor-combinatorsaTakes a "splitting" method and the two sub-consumers, and returns the wrapped/combined consumer.vfunctor-combinatorsCombine a consumer of a with a consumer of b to get a consumer of (a, b). v = u 3 wfunctor-combinatorsThe Contravariant version of 85: split the same input over two different consumers.xfunctor-combinators)Convenient helper function to build up a t+ by splitting input across many different f a%s. Most useful when used alongside 9: Sdsum1 $ contramap get1 x :| [ contramap get2 y , contramap get3 z ] {functor-combinatorsUnlike 4, requires only 5 on f.functor-combinatorsUnlike 4, requires only 5 on f.functor-combinatorsUnlike 4, requires only : on m.functor-combinatorsUnlike 4, requires only : on m.functor-combinatorsUnlike 4, requires only : on r.qrstuvwxtuvwxqrs(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;=>?@ACEHMPSUVX_fgkq^functor-combinatorsThe contravariant analogue of ;.If one thinks of f a as a consumer of as, then  allows one to handle the consumption of a value by choosing to handle it via exactly one of two independent consumers. It redirects the input completely into one of two consumers.i takes the "decision" method and the two potential consumers, and returns the wrapped/combined consumer./Mathematically, a functor being an instance of f means that it is "semgroupoidal" with respect to the contravariant "either-based" Day convolution (Jdata EitherDay f g a = forall b c. EitherDay (f b) (g c) (a -> Either b c)1). That is, it is possible to define a function (f  EitherDay f) a -> f a in a way that is associative.functor-combinatorshTakes the "decision" method and the two potential consumers, and returns the wrapped/combined consumer.functor-combinatorsFor  x y, the resulting f (< b c) will direct =s to be consumed by x, and >s to be consumed by y.functor-combinatorsUnlike ?, requires only 5 on f.functor-combinatorsUnlike ?, requires only 5 on f.functor-combinatorsUnlike ?, requires no constraint on r(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;=>?@ACEHMPSUVX_fgkqfunctor-combinatorsThe contravariant analogue of +,. Adds on to b the ability to express a combinator that rejects all input, to act as the dead-end. Essentially ?% without a superclass constraint on 4.If one thinks of f a as a consumer of as, then . defines a consumer that cannot ever receive any input."Conclude acts as an identity with &, because any decision that involves  must necessarily always pick the other option.That is, for, say,  f x  f< is the deciding function that picks which of the inputs of decide. to direct input to; in the situation above, f must always direct all input to x , and never ./Mathematically, a functor being an instance of  means that it is "monoidal" with respect to the contravariant "either-based" Day convolution described in the documentation of . On top of +, it adds a way to construct an "identity" conclude where decide f x (conclude q) == x, and decide g (conclude r) y == y.functor-combinators&The consumer that cannot ever receive any input.functor-combinators&A potentially more meaningful form of ), the consumer that cannot ever receive any8 input. That is because it expects only input of type @ , but such a type has no values.  =  3 (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq!functor-combinatorsFor any A f%, produce a value that would require B f.&Always use with concrete and specific f only, and never use with any f that already has a B 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.functor-combinatorsFor any ' f%, produce a value that would require 5 f.&Always use with concrete and specific f only, and never use with any f that already has a 5 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.functor-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.functor-combinatorsFor any ' f&, produce a value that would require C f.&Always use with concrete and specific f only, and never use with any f that already has a C 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.functor-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.functor-combinatorsFor any 4 f%, produce a value that would require t f.&Always use with concrete and specific f only, and never use with any f that already has a t 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.(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;=>?@ACEHMPSUVX_fgkoq| functor-combinatorsAn f a, along with a D index.  f a ~ (D , 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 D 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 01 (E D).functor-combinatorsA non-empty map of D to f a!. Basically, contains multiple f as, each at a given D index.  Steps f a ~ 23 D (f a) Steps f ~ 23 D ( f -- functor composition )It is the fixed point of applications of 45.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 452, we know we have at least one f at one position  somewhere.A  f a has potentially many fs, each stored at a different D0 position, with the guaruntee that at least one f exists.!Can be useful for using with the  instance of 45. ing it requires at least an FU instance in the target context, since we have to handle potentially more than one f.%This type is essentailly the same as  6 (E D) (except with a different : 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-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinators functor-combinatorsAn f a, along with a % flag   f a ~ (% , f a) Flagged f ~ ((,) Bool) ( f -- functor composition Creation with   or 1 uses G 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 1) as G0, or "impure" (made from some other source) as H . However, GC 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:  7 89 :1 Ifunctor-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-combinatorsfunctor-combinatorsfunctor-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 G for J.*functor-combinatorsUses G for 1, and K for L.8functor-combinators8 a b is uninhabited for all a and b.9functor-combinatorsIf you treat a & f a as a functor combinator, then 9 lets you convert from a & f a into a t f a for any functor combinator t.:functor-combinators;functor-combinatorsMfunctor-combinatorsIf you treat a 8 f a' as a binary functor combinator, then M lets you convert from a 8 f a into a t f a for any functor combinator t.Nfunctor-combinatorsOfunctor-combinators   &89M   &98M (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqH$Ufunctor-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 B.Incidentally, if used with a M f, this is instead the free 4.dfunctor-combinatorsA non-empty list of f aVs. Can be used to describe a product between many different possible values of type f a. Essentially: d/ 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 B on any & f.Incidentally, if used with a M f, this is instead the free t.gfunctor-combinators$Map a function over the inside of a U.hfunctor-combinatorsifunctor-combinatorsjfunctor-combinatorskfunctor-combinatorslfunctor-combinatorsmfunctor-combinatorsnfunctor-combinatorsfunctor-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.functor-combinatorsTreat a d f as a product between an f and a U f. is the record accessor.functor-combinators$Map a function over the inside of a d.functor-combinators Convert a d into a U with at least one item.functor-combinators Convert a U either a d, or a N& in the case that the list was empty.functor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-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 01 and U, in a way --- a  k f a is like a U (01 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 =  O Command See Q for a non-empty variant, if you want to enforce that your bag has at least one f a.functor-combinators$Map a function over the inside of a .functor-combinators Convert a  into a U with zero or one items.functor-combinators Convert a U into a  containing the first f a in the list, if it exists.functor-combinatorsPicks the first P.functor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-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 01 and d, in a way --- an  k f a is like a d (01 k f) a! with unique (and ordered) keys.See  for some use cases.functor-combinatorsLeft-biased unionfunctor-combinators&A union, combining matching keys with Q.functor-combinatorsLeft-biased unionfunctor-combinators&A union, combining matching keys with Q.UVWdefgUVWgdef (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqfunctor-combinatorsA value of type  a is "proof" that a is uninhabited.functor-combinatorsxA pairing of contravariant functors to create a new contravariant functor that represents the "choice" between the two.A  f g a" is a contravariant "consumer" of a*, and it does this by either feeding the a to f, or feeding the a to g:. Which one it gives it to happens at runtime depending what a is actually given.For example, if we have x :: f a (a consumer of as) and y :: g b (a consumer of b s), then  x y ::  f g (< a b). This is a consumer of < a bs, and it consumes = branches by feeding it to x, and > branches by feeding it to y.gMathematically, this is a contravariant day convolution, except with a different choice of bifunctor (<=) than the typical one we talk about in Haskell (which uses (,)4). Therefore, it is an alternative to the typical ;<! convolution --- hence, the name .functor-combinatorsInject into a . x y is a consumer of < a b; = will be passed to x, and > will be passed to y.functor-combinatorsInterpret out of a  into any instance of * by providing two interpreting functions.functor-combinators is associative.functor-combinators is associative.functor-combinatorsThe two sides of a  can be swapped.functor-combinators)Hoist a function over the left side of a .functor-combinators*Hoist a function over the right side of a .functor-combinators&A useful shortcut for a common usage: @ is always not so.functor-combinatorsThe left identity of  is (; this is one side of that isomorphism.functor-combinatorsThe right identity of  is (; this is one side of that isomorphism.functor-combinatorsThe left identity of  is (; this is one side of that isomorphism.functor-combinatorsThe right identity of  is (; this is one side of that isomorphism.functor-combinators (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqfunctor-combinatorspA pairing of invariant functors to create a new invariant functor that represents the "choice" between the two.A  f g a- is a invariant "consumer" and "producer" of a*, and it does this by either feeding the a to f, or feeding the a to g, and then collecting the result from whichever one it was fed to. Which decision of which path to takes happens at runtime depending what a is actually given.For example, if we have x :: f a and y :: g b, then  x y ::  f g (< a b)". This is a consumer/producer of < a bs, and it consumes = branches by feeding it to x, and > branches by feeding it to yR. It then passes back the single result from the one of the two that was chosen.cMathematically, this is a invariant day convolution, except with a different choice of bifunctor (<=) than the typical one we talk about in Haskell (which uses (,)4). Therefore, it is an alternative to the typical ;<! convolution --- hence, the name .functor-combinators+Pair two invariant actions together into a ; assigns the first one to =* inputs and outputs and the second one to > inputs and outputs.functor-combinators"Interpret the covariant part of a  into a target context h,, as long as the context is an instance of F. The F6 is used to combine results back together, chosen by Q.functor-combinators&Interpret the contravariant part of a  into a target context h+, as long as the context is an instance of . The 2 is used to pick which part to feed the input to.functor-combinatorsConvert an invariant > into the covariant version, dropping the contravariant part.+Note that there is no covariant version of B defined in any common library, so we use an equivalent type (if f and g are &s) f  g.functor-combinatorsConvert an invariant > into the covariant version, dropping the contravariant part. This version does not require a &j constraint because it converts to the coyoneda-wrapped product, which is more accurately the covariant  convolution.functor-combinatorsConvert an invariant > into the contravariant version, dropping the covariant part.functor-combinators is associative.functor-combinators is associative.functor-combinatorsThe left identity of  is (; this is one side of that isomorphism.functor-combinatorsThe right identity of  is (; this is one side of that isomorphism.functor-combinatorsThe left identity of  is (; this is one side of that isomorphism.functor-combinatorsThe right identity of  is (; this is one side of that isomorphism.functor-combinatorsThe two sides of a  can be swapped.functor-combinators)Hoist a function over the left side of a .functor-combinators*Hoist a function over the right side of a .=None-%&',-./1245678;<=>?@ACEHMPSUVX_fgkq@Rfunctor-combinators,Internal type, used to not require dlist-1.0functor-combinators(Useful newtype to allow us to derive an   instance from any instance of , using -XDerivingVia.For example, because we have  instance  , we can write: deriving via (  f) instance   ( f) to give us an automatic   instance and save us some work.functor-combinatorsA  is like an  , 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  .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:   3 id == id This ensures that  ,  , and  # 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. functor-combinators4Swap out both transformed functors at the same time. functor-combinatorsAn   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   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.   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  > and %.This class is similar to ?@ from Control.Monad.Morph$, but instances must work without a * constraint. This class is also found in the hschema library with the same name. functor-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   3 == id  Essentially, t f adds some "extra structure" to f.   must swap out the functor, %without affecting the added structure. For example, U f a is essentially a list of f a s. If we   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,  Q must preserve the number of items in the list, and must maintain the ordering.The law   3 == id' is a way of formalizing this property.Sfunctor-combinators,Isomorphism between different varieities of .Tfunctor-combinators,Isomorphism between different varieities of .functor-combinatorsTurn U into any ' f$. Can be useful as an argument to  ,  , or .It is a more general form of ?A from mmorph.functor-combinators(Natural transformation from any functor f into N3. Can be useful for "zeroing out" a functor with   or   or .Vfunctor-combinatorsWfunctor-combinatorsXfunctor-combinatorsNote that there is no % or  B instance, because   requires & f.Yfunctor-combinatorsNote that there is no % or  B instance, because   requires & f.Zfunctor-combinators[functor-combinators\functor-combinators]functor-combinatorsR     ST^_ (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq)functor-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  ().functor-combinatorsLift an isomorphism over an  .Essentailly, if f and g are isomorphic, then so are t f and t g.functor-combinators`Functor combinator that forgets all structure on the input, and instead stores a value of type e.Like 9, 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$functor-combinators%functor-combinators&functor-combinators'functor-combinators(functor-combinators)functor-combinators7functor-combinators7 is effectively a "higher-order *", in the sense that   is a "higher-order &".%It can be considered a typeclass for  .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: 8 ; == 3 But 82 should also be associatiatve, in a way that makes 9 . hjoin = hjoin .   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 8 and > (though they both may typecheck) produce different behavior.This class is similar to ?C from Control.Monad.Morph$, but instances must work without a * constraint.8functor-combinatorsBind a continuation to a t f into some context g.9functor-combinatorsCollapse a nested t (t f) into a single t f.:functor-combinatorsA typeclass for  s 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 ` from a. 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 C.<functor-combinatorsAn "  combinator" that turns an  - into potentially infinite nestings of that  .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 =  O Command And you can represent multiple nested named commands using: type NestedCommands = < ( O)  This has an %T instance, but it can be more useful to use via direct pattern matching, or through C ::  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 7 for any   t. Note that <  is equivalent to .?functor-combinatorsAn "  combinator" that enhances an  $ 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  DE.Bfunctor-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 :".Cfunctor-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 <.Dfunctor-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 )".Efunctor-combinatorsPA useful wrapper over the common pattern of fmap-before-inject/inject-and-fmap.Ffunctor-combinatorsZA useful wrapper over the common pattern of contramap-before-inject/inject-and-contramap.Hfunctor-combinatorsIfunctor-combinatorsJfunctor-combinatorsKfunctor-combinatorsMfunctor-combinatorsNfunctor-combinatorsXfunctor-combinators< is the "free 7 and : " for any  mfunctor-combinators Only uses bnfunctor-combinators Only uses brfunctor-combinators Injects with G.Equivalent to instance for  DE and ? .sfunctor-combinators4Injects into a singleton map at 0; same behavior as  (DF GH).tfunctor-combinatorsInjects with 0.Equivalent to instance for  (DF GH).ufunctor-combinators Injects into a singleton map at c.vfunctor-combinators Injects into a singleton map at c.{functor-combinators}functor-combinators< is the "free 7 " for any  functor-combinators'Combines the accumulators, Writer-stylefunctor-combinatorsEquivalent to instance for  DE and ? .functor-combinatorsEquivalent to instance for  (DF GH).   !789:;<=>?@ABCDEF  :;789 !?@AB<=>CDEF(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq.)functor-combinators9A newtype wrapper meant to be used to define polymorphic $ instances. See documentation for  for more information.)Please do not ever define an instance of " "naked" on the second parameter:  instance Interpret (WrapHF t) f -As that would globally ruin everything using .functor-combinatorsA constraint on a for both c a and d a . Requiring  - d a is the same as requiring (- a, d a).functor-combinators A version of e that supports F, B, , and 1 instances. It does this by avoiding having an A or ?N instance, which causes all sorts of problems with the interactions between 'Alternative'/'Applicative' and <'Decidable'/'Data.Functor.Contravariant.Divisible.Divisible'.functor-combinatorsAn + lets us move in and out of the "enhanced" & (t f) and the functor it enhances (f). An instance  t f means we have  t f a -> f a. 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 *.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.&Note that instances of this class are intended to be written with t# as a fixed type constructor, and f to be allowed to vary freely: %instance Monad f => Interpret Free f Any other sort of instance and it's easy to run into problems with type inference. If you want to write an instance that's "polymorphic" on tensor choice, use the _ newtype wrapper over a type variable, where the second argument also uses a type constructor: ,instance Interpret (WrapHF t) (MyFunctor t) 5This will prevent problems with overloaded instances.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 f in  t f%, you may have extra constraints on b.If f/ is unconstrained, there are no constraints on bIf f must be 5, F, t, or , b needs to be an instance of :.If f is ', B, 4, or , b needs to be an instance of fFor 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-combinators(Deprecated) Old name for '; will be removed in a future version.functor-combinatorsUseful wrapper over  to allow you to collect a b from all instances of f inside a t f a.%Will work if there is an instance of  t ( m) if f mE, which will be the case if the constraint on the target functor is &, 5, ', F, B, , 4, , , or unconstrained. -- get the lengths of all  Map String s in the  . 3 length :: Ap (Map String) Bool -> [Int] functor-combinators(Deprecated) Old name for '; will be removed in a future version.functor-combinatorsUseful wrapper over  to allow you to collect a b from all instances of f inside a t f a!, into a non-empty collection of bs.%Will work if there is an instance of  t ( m) if : mE, which will be the case if the constraint on the target functor is &, 5, F, t, , or unconstrained. -- get the lengths of all  Map String s in the  . . length :: Ap1 (Map String) Bool -> g Int functor-combinatorsUseful wrapper over 3 to allow you to directly consume a value of type a with a t f a to create a b<. Do this by supplying the method by which each component f x can consume an x;. This works for contravariant functor combinators, where t f a& can be interpreted as a consumer of as.*Note that depending on the constraints on f in  t f%, you may have extra constraints on b.If f is unconstrained, , or $, there are no constraints on bB. This will be the case for combinators like contravariant h, Dec, Dec1.If f must be t, b" needs to be an instance of :.. This will be the case for combinators like Div1.If f is 4, b needs to be an instance of f3. This will be the case for combinators like Div.For any & or i constraint, this is not usable.functor-combinatorsUseful wrapper over 3 to allow you to directly consume a value of type a with a t f a to create a b , and create a list of all the bs created by all the f=s. Do this by supplying the method by which each component f x can consume an x;. This works for contravariant functor combinators, where t f a& can be interpreted as a consumer of as.%Will work if there is an instance of  t (j m) if f mE, which will be the case if the constraint on the target functor is M, , , t, 4, or unconstrained.0Note that this is really only useful outside of  for Div and Div1 , where a Div f) which is a collection of many different f?s consuming types of different values. You can use this with Dec and Dec1 and the contravarient h\ as well, but those would always just give you a singleton list, so you might as well use 5. This is really only here for completion alongside 8, or if you define your own custom functor combinators.functor-combinatorsUseful wrapper over 3 to allow you to directly consume a value of type a with a t f a to create a b , and create a list of all the bs created by all the f=s. Do this by supplying the method by which each component f x can consume an x;. This works for contravariant functor combinators, where t f a& can be interpreted as a consumer of as.%Will work if there is an instance of  t (j m) if f mE, which will be the case if the constraint on the target functor is M, , t, or unconstrained.0Note that this is really only useful outside of  and  for Div1 , where a Div1 f* which is a collection of many different f>s consuming types of different values. You can use this with Dec and Dec1 and the contravarient h\ as well, but those would always just give you a singleton list, so you might as well use 6. This is really only here for completion alongside 7, or if you define your own custom functor combinators.functor-combinators Never uses ;functor-combinators Never uses ;functor-combinators!This ignores the environment, so  /= 8functor-combinatorsA free k, but only when applied to a *.functor-combinatorsA free Cfunctor-combinatorsA free Cfunctor-combinatorsA free 'functor-combinatorsA free 'functor-combinatorsA free )functor-combinatorsA free *functor-combinators Technically, f# is over-constrained: we only need b :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use B here instead, but we never use QD. This would only go wrong in situations where your type supports b but not Q, like instances of IJ without KL.functor-combinators Technically, f# is over-constrained: we only need b :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use B here instead, but we never use QD. This would only go wrong in situations where your type supports b but not Q, like instances of IJ without KL.functor-combinatorsA free Afunctor-combinators Technically, f# is over-constrained: we only need b :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use B here instead, but we never use QD. This would only go wrong in situations where your type supports b but not Q, like instances of IJ without KL.functor-combinatorsEquivalent to instance for  DE and ? .functor-combinatorsEquivalent to instance for  (DF GH).functor-combinators Technically, f# is over-constrained: we only need b :: f aQ, but we don't really have that typeclass in any standard hierarchies. We use B here instead, but we never use QD. This would only go wrong in situations where your type supports b but not Q, like instances of IJ without KL.functor-combinatorsA free Ffunctor-combinatorsA free Bfunctor-combinatorsA free 'functor-combinatorsA free Mfunctor-combinatorsA free &functor-combinators Unlike for e', this is possible because there is no ? instance to complicate things.functor-combinators Unlike for e', this is possible because there is no ? instance to complicate things.functor-combinators Unlike for e', this is possible because there is no A instance to complicate things.functor-combinators Unlike for e', this is possible because there is no A instance to complicate things. (c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;<=>?@ACEHMPSUVX_fgkq;functor-combinatorsAn ) that ignores its second input. Like a  with no /right branch.This is MN 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 OP.            QNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq%functor-combinators;Instead of defining yet another separate free monoid like RS, T, or U , we re-use -.1You can assemble values using the combinators in Data.HFunctor.Chain0, and then tear them down/interpret them using runCoNightChain and runContraNightChain9. There is no general invariant interpreter (and so no MonoidIn instance for Night) because the typeclasses used to express the target contexts are probably not worth defining given how little the Haskell ecosystem uses invariant functors as an abstraction.&functor-combinators>Instead of defining yet another separate free semigroup like V, W, or X , we re-use 0.1You can assemble values using the combinators in Data.HFunctor.Chain0, and then tear them down/interpret them using runCoNightChain1 and runContraNightChain19. There is no general invariant interpreter (and so no  SemigroupIn instance for Night) because the typeclasses used to express the target contexts are probably not worth defining given how little the Haskell ecosystem uses invariant functors as an abstraction.'functor-combinators;Instead of defining yet another separate free monoid like RS, T, or U , we re-use -.1You can assemble values using the combinators in Data.HFunctor.Chain0, and then tear them down/interpret them using  runCoDayChain and runContraDayChain9. There is no general invariant interpreter (and so no MonoidIn instance for Day) because the typeclasses used to express the target contexts are probably not worth defining given how little the Haskell ecosystem uses invariant functors as an abstraction.*functor-combinators>Instead of defining yet another separate free semigroup like V, W, or X , we re-use 0.1You can assemble values using the combinators in Data.HFunctor.Chain0, and then tear them down/interpret them using runCoDayChain1 and runContraDayChain19. There is no general invariant interpreter (and so no  SemigroupIn instance for Day) because the typeclasses used to express the target contexts are probably not worth defining given how little the Haskell ecosystem uses invariant functors as an abstraction.-functor-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 ListBy t.If t is TensorI, then it means we can "collapse" this linked list into some final type ListBy t (reroll1), and also extract it back into a linked list (unroll).So, a value of type - t i f a is one of either: i 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 ListBy t is supposed to be. Using - allows us to work with all ListBy tJs in a uniform way, with normal pattern matching and normal constructors.You can fully "collapse" a - t i f into an f with retract, if you have MonoidIn t i fB; this could be considered a fundamental property of monoid-ness.(Another way of thinking of this is that - t i is the "free MonoidIn t i". Given any functor f, - t i fC is a monoid in the monoidal category of endofunctors enriched by t. So, - Y U is the "free *", - Z< U is the "free '", etc. You "lift" from f a to - t i f a using ;.iNote: this instance doesn't exist directly because of restrictions in typeclasses, but is implemented as Tensor t i => MonoidIn (WrapHBF t) (WrapF i) (- t i f) where pureT is . and  biretract is  appendChain."This construction is inspired by 6http://oleg.fi/gists/posts/2018-02-21-single-free.html0functor-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  NonEmptyBy t.A 0 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  NonEmptyBy t1. And that's "the point": for all instances of  Associative, 0 t is isomorphic to  NonEmptyBy t (witnessed by  unrollingNE). That's big picture of  NonEmptyByQ: it's supposed to be a type that consists of all possible self-applications of f to t.0" gives you a way to work with all  NonEmptyBy t in a uniform way. Unlike for  NonEmptyBy t f= in general, you can always explicitly /pattern match/ on a 0L (with its two constructors) and do what you please with it. You can also  construct 0* using normal constructors and functions.You can convert in between  NonEmptyBy t f and 0 t f with unrollNE and rerollNE. You can fully "collapse" a 0 t f into an f with retract, if you have  SemigroupIn t fE; this could be considered a fundamental property of semigroup-ness.See -) for a version that has an "empty" value.(Another way of thinking of this is that 0 t is the "free  SemigroupIn t". Given any functor f, 0 t fM is a semigroup in the semigroupoidal category of endofunctors enriched by t. So, 0 Y is the "free [B", 0 Day is the "free \]", etc. You "lift" from f a to 0 t f a using ;.iNote: this instance doesn't exist directly because of restrictions in typeclasses, but is implemented as  Associative t =>  SemigroupIn (WrapHBF t) (0 t f) where  biretract is  appendChain1.You can fully "collapse" a - t i f into an f with retract, if you have MonoidIn t i fB; this could be considered a fundamental property of monoid-ness.8This construction is inspired by iteratees and machines.3functor-combinatorsRecursively fold down a 04. 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 0 t f into a single g.This is a catamorphism.4functor-combinatorsRecursively build up a 05. 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 0 t f from a g.This is an anamorphism.5functor-combinators#Convert a tensor value pairing two fs into a two-item 0. An analogue of  toNonEmptyBy.6functor-combinatorsCreate a singleton 0.7functor-combinators)For completeness, an isomorphism between 0% and its two constructors, to match matchNE.8functor-combinatorsRecursively fold down a -4. Provide a function on how to handle the "single f case" (nilLB#), 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.9functor-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-combinators)For completeness, an isomorphism between -% and its two constructors, to match  splittingLB.;functor-combinatorsAn analogue of unconsLB*: match one of the two constructors of a -.lfunctor-combinatorsmfunctor-combinators3functor-combinatorshandle 1functor-combinatorshandle 28functor-combinatorsHandle .functor-combinatorsHandle /%no&pq'()*+,-/.0123456789:;(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;<=>?@ACEHMPSUVX_fgkqD<functor-combinators The free : a non-empty version of >.>functor-combinators The free d. Used to aggregate multiple possible consumers, directing the input into an appropriate consumer.Afunctor-combinators The free t: a non-empty version of D.This type is essentially d=; the only reason why it has to exist separately outside of dV is because the current typeclass hierarchy isn't compatible with both the covariant  instance (requiring Plus) and the contravariant  instance (requiring 4).The wrapping in h is also to provide a usable ^! instance for the contravariant r.Dfunctor-combinators The free 4d. Used to sequence multiple contravariant consumers, splitting out the input across all consumers.This type is essentially U=; the only reason why it has to exist separately outside of UV is because the current typeclass hierarchy isn't compatible with both the covariant  instance (requiring Plus) and the contravariant  instance (requiring 4).The wrapping in h is also to provide a usable ^! instance for the contravariant r.Gfunctor-combinatorsPattern matching on a A, exposing the raw f$ instead of having it wrapped in a h. This is the analogue of \V+ and essentially treats the "cons" of the A$ as a contravariant day convolution.=Before v0.3.3.0, this used to be the concrete constructor of A(. After, it is now an abstract pattern.Hfunctor-combinators Pattern matching on a non-empty D, exposing the raw f$ instead of having it wrapped in a h. This is the analogue of R_+ and essentially treats the "cons" of the D$ as a contravariant day convolution.=Before v0.3.3.0, this used to be the concrete constructor of D(. After, it is now an abstract pattern.Ifunctor-combinatorsPattern matching on an empty D.=Before v0.3.3.0, this used to be the concrete constructor of D(. After, it is now an abstract pattern.Jfunctor-combinatorsD is isomorphic to U for contravariant f/. This witnesses one way of that isomorphism.Kfunctor-combinatorsD is isomorphic to U for contravariant f/. This witnesses one way of that isomorphism.Lfunctor-combinators#Map over the undering context in a D.Mfunctor-combinatorsInject a single action in f into a D f.Nfunctor-combinators Interpret a D into a context g , provided g is 4.Ofunctor-combinatorsA A is a "non-empty" DR; this function "forgets" the non-empty property and turns it back into a normal D.Pfunctor-combinators%Map over the underlying context in a A.Qfunctor-combinatorsInject a single action in f into a D f.Rfunctor-combinators Interpret a A into a context g , provided g is t.Sfunctor-combinatorsA is isomorphic to d for contravariant f/. This witnesses one way of that isomorphism.Tfunctor-combinatorsA is isomorphic to d for contravariant f/. This witnesses one way of that isomorphism.Ufunctor-combinators%Map over the underlying context in a >.Vfunctor-combinatorsInject a single action in f into a > f.Wfunctor-combinators Interpret a > into a context g , provided g is .Xfunctor-combinatorsA < is a "non-empty" >R; this function "forgets" the non-empty property and turns it back into a normal >.Yfunctor-combinators#Map over the undering context in a <.Zfunctor-combinatorsInject a single action in f into a < f.[functor-combinators Interpret a < into a context g , provided g is . <=>?@AGBCDIHEFJKLMNOPQRSTUVWXYZ[#DIHEFIHLMNJKAGBCGPQORST>?@UVW<=YZX[(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq`vfunctor-combinators One or more fs convolved with itself. Essentially: v1 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   and - instance, along with its relationship with   and .This is the free 5 --- Basically a "non-empty"  ."The construction here is based on  , similar to now `a is built on list.xfunctor-combinatorsAn v f is just a  f (  f)A. This bidirectional pattern synonym lets you treat it as such.zfunctor-combinatorsAn v 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 v if possible. If the   was "empty", return the s value instead.|functor-combinators Embed an f into v.}functor-combinators Extract the f out of the v. } . | == id ~functor-combinators Interpret an   f into some 5 context g.functor-combinators vxywz{|}~ vxywxz{|}~(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq=x&functor-combinatorsKA typeclass associating a free structure with the typeclass it is free on.$This essentially lists instances of  where a "trip" through  will leave it unchanged.  .  == id  .  == id This can be useful because S 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.functor-combinators6What "type" of functor is expected: should be either t, &, M, or i.functor-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 ->  * f a 8When you want to eventually interpret out the data, use:  :: (f  g) ->  c f a -> g a  Essentially,  c is the "free c".  * is the free *, etc. can theoretically replace  , v, U, d, , ", bc, , and other instances of M, 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 d, e, fg, 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  c as an instance of c (using , ,  for help).functor-combinatorsLift an action into a .functor-combinatorsMap the action in a .functor-combinators Merge two  actions.functor-combinators!Re-interpret the context under a .functor-combinatorsFinalize an  instance.  toFinal ::  f   & f toFinal ::   f   ' f toFinal :: F f   A f toFinal :: " f   * f toFinal ::  f   C f toFinal :: U f   B f Note that the instance of c for  c must be defined.This operation can potentially forget structure in t. For example, we have:  :: e f ~>  F f 8In this process, we lose the "positional" structure of e.In the case where C doesn't lose any information, this will form an isomorphism with , and t is known as the "Free c". For such a situation, t will have a  instance.functor-combinators Concretize a .  fromFinal ::  & f   f fromFinal ::  ' f    f fromFinal ::  A f  F f fromFinal ::  * f  " f fromFinal ::  C f   f fromFinal ::  B f  U f This can be useful because S doesn't have a concrete structure that you can pattern match on and inspect, but t might.0In the case that this forms an isomorphism with , the t will have an instance of .functor-combinators=The isomorphism between a free structure and its encoding as .functor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsThis could also be  4 if  U ~ MD. However, there isn't really a way to express this at the moment.functor-combinatorsThis could also be  t if  d ~ MD. However, there isn't really a way to express this at the moment.functor-combinators(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone-%&',-./1245678;<=>?@ACEHMPSUVX_fgkq#functor-combinatorsAny  t f is a  t if we have  tj. This newtype wrapper witnesses that fact. We require a newtype wrapper to avoid overlapping instances.functor-combinators9A newtype wrapper meant to be used to define polymorphic $ instances. See documentation for  for more information.)Please do not ever define an instance of " "naked" on the second parameter: #instance SemigroupIn (WrapHBF t) f -As that would globally ruin everything using .functor-combinatorsFor different  t, we have functors f that we can "squash", using :  t f f ~> f 4This gives us the ability to squash applications of t.Formally, if we have  t, we are enriching the category of endofunctors with semigroup structure, turning it into a semigroupoidal category. Different choices of t+ give different semigroupoidal categories. A functor fO is known as a "semigroup in the (semigroupoidal) category of endofunctors on t " if we can :  t f f ~> f pThis gives us a few interesting results in category theory, which you can stil reading about if you don't care:All? functors are semigroups in the semigroupoidal category on PThe class of functors that are semigroups in the semigroupoidal category on 3 is exactly the functors that are instances of F.PThe class of functors that are semigroups in the semigroupoidal category on 3 is exactly the functors that are instances of 5.PThe class of functors that are semigroups in the semigroupoidal category on 3 is exactly the functors that are instances of ).&Note that instances of this class are intended to be written with t# as a fixed type constructor, and f to be allowed to vary freely: &instance Bind f => SemigroupIn Comp f Any other sort of instance and it's easy to run into problems with type inference. If you want to write an instance that's "polymorphic" on tensor choice, use the _ newtype wrapper over a type variable, where the second argument also uses a type constructor: 1instance SemigroupIn (WrapHBF t) (MyFunctor t i) 5This will prevent problems with overloaded instances.functor-combinatorsThe  analogy of . It retracts both fs into a single f), effectively fully mixing them together.This function makes fE a semigroup in the category of endofunctors with respect to tensor t.functor-combinatorsThe  analogy of X. It takes two interpreting functions, and mixes them together into a target functor h.hNote that this is useful in the poly-kinded case, but it is not possible to define generically for all ! because it only is defined for  Type -> Type inputes. See ( for a version that is poly-kinded for  in specific.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   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.Formally, we can say that t enriches a the category of endofunctors with semigroup strcture: it turns our endofunctor category into a "semigroupoidal category".Different instances of te each enrich the endofunctor category in different ways, giving a different semigroupoidal category.functor-combinators0The "semigroup functor combinator" generated by t.A value of type NonEmptyBy 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 d. This is because: x ~ d (x u []) ~ ; 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 .See h. for a "possibly empty" version of this type.functor-combinators{A description of "what type of Functor" this tensor is expected to be applied to. This should typically always be either &, M, or i.functor-combinatorsThe isomorphism between  t f (t g h) a and  t (t f g) h a!. To use this isomorphism, see  and .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.1Note that this essentially gives an instance for  t (NonEmptyBy t f), for any functor f.functor-combinatorsIf a  t f% represents multiple applications of t fO to itself, then we can split it based on whether or not it is just a single f* or at least one top-level application of t f.)Note that you can recursively "unroll" a  completely into a i by using j.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-combinatorsReassociate an application of t.functor-combinatorsReassociate an application of t.functor-combinatorsAn implementation of ! that works for any instance of  t for  t.?Can be useful as a default implementation if you already have  implemented.functor-combinatorsAn implementation of ! that works for any instance of  t for  t.?Can be useful as a default implementation if you already have  implemented.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 (NonEmptyBy 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 g a, if you can convert an f x and g x into b.*Note that depending on the constraints on h in  t h%, you may have extra constraints on b.If h/ is unconstrained, there are no constraints on bIf h must be 5, F, t, or , b needs to be an instance of :If h is ', B, kl , or m, b" needs to be an instance of fFor 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 v  w length :: ([] :+: n3 x) yO -> Int -- Return the length of both the list and the map, added together  (oF! . 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 v w  length :: ([] :+: n3 x) yO -> Int -- Return the length of both the list and the map, added together oF" . length !$! Sum . length :: " [] (Map Int) Char -> Sum Int functor-combinatorsInfix alias for hNote that this is useful in the poly-kinded case, but it is not possible to define generically for all ! because it only is defined for  Type -> Type inputes. See ( for a version that is poly-kinded for  in specific.functor-combinators A version of  specifically for  that is poly-kindedfunctor-combinatorsUseful wrapper over + to allow you to directly extract a value b out of the t f g a, if you can convert an f x and g x into b , given an x input.*Note that depending on the constraints on h in  t h%, you may have extra constraints on b.If h/ is unconstrained, there are no constraints on bIf h must be t, or  Divisible, b needs to be an instance of :If h must be  Divisible, then b needs to be an instance of f.For some constraints (like *), this will not be usable.functor-combinators Ideally here  would be equivalent to h, 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.functor-combinatorsfunctor-combinators functor-combinators Instances of )3 are semigroups in the semigroupoidal category on . functor-combinators>All functors are semigroups in the semigroupoidal category on 8.functor-combinators>All functors are semigroups in the semigroupoidal category on z.functor-combinators>All functors are semigroups in the semigroupoidal category on .functor-combinatorsfunctor-combinatorsfunctor-combinators Instances of 53 are semigroups in the semigroupoidal category on .functor-combinators Instances of F3 are semigroups in the semigroupoidal category on {.functor-combinators Instances of F3 are semigroups in the semigroupoidal category on .555pNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq (functor-combinatorsAn   can be a ( if there is some identity i where t i f and t f i are 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 ;.Formally, we can say that t~ enriches a the category of endofunctors with monoid strcture: it turns our endofunctor category into a "monoidal category".Different instances of t_ each enrich the endofunctor category in different ways, giving a different monoidal category.)functor-combinators-The "monoidal functor combinator" induced by t.A value of type  ListBy 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 ListF. This is because: Proxy ~ ListF [] ~ 3 @(%) x ~ ListF [x] ~ ;& x x :*: y ~ ListF [x,y] ~ 11 (x :*: y) x :*: y :*: z ~ ListF [x,y,z] -- etc. #You can create an "empty" one with 3, a "singleton" one with ;, or else one from a single t f f with 1.See ) for a "non-empty" version of this type.*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 i is the identity of t: t f i always leaves f, unchanged, so we can always just drop the i.-functor-combinatorsWitnesses the property that i is the identity of t: t i g always leaves g+ unchanged, so we can always just drop the i t..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.1Note that this essentially gives an instance for  t (ListBy t f), for any functor f; this is witnessed by WrapLB./functor-combinatorsLets you convert an  t f into a single application of f to ) t f.Analogous to a function `a a -> (a, [a])<Note that this is not reversible in general unless we have  Matchable t.0functor-combinatorsAn ) t f- is either empty, or a single application of t to f and  ListBy t f< (the "head" and "tail"). This witnesses that isomorphism.To use this property, see 3, 4, and 5.1functor-combinatorsEmbed a direct application of f to itself into a ) t f.2functor-combinators t f is "one or more fs", and  'ListBy t f is "zero or more f9s". This function lets us convert from one to the other. This is analogous to a function `a a -> [a].Note that because tN is not inferrable from the input or output type, you should call this using -XTypeApplications: 2 @() ::  NonEmptyF f a -> ListF f a fromNE @Comp :: Free1 f a -> Free f a 3functor-combinatorsCreate the "empty )".If ) t f% represents multiple applications of t f with itself, then nilLB gives us "zero applications of f". Note that t6 cannot be inferred from the input or output type of 3A, so this function must always be called with -XTypeApplications: 3 @Day :: Identity  Ap f nilLB @Comp :: Identity ~> Free f nilLB @() :: Proxy ~> ListF f 1Note that this essentially gives an instance for MonoidIn t i (ListBy t f), for any functor f; this is witnessed by WrapLB.4functor-combinators!Lets us "cons" an application of f to the front of an ) t f.5functor-combinators"Pattern match" on an ) tAn ) t f- is either empty, or a single application of t to f and  ListBy t f (the "head" and "tail")"This is analogous to the function qr :: [a] -> Maybe (a, [a]).6functor-combinators- is a monoid with respect to t]: we can "combine" them in an associative way. The identity here is anything made with the . constructor.This is essentially , but only requiring ( t i: it comes from the fact that 0 t i is the "free MonoidIn t i". pureT is ..7functor-combinatorsA type ) t9 is supposed to represent the successive application of ts to itself. 7M makes that successive application explicit, buy converting it to a literal - of applications of t to itself. 7 = 9 5 8functor-combinatorsA type ) t9 is supposed to represent the successive application of ts to itself. 9 takes an explicit - of applications of t( to itself and rolls it back up into an ) t. 8 = 8 3 4 Because tI cannot be inferred from the input or output, you should call this with -XTypeApplications: 8 @Y :: - Comp bc f a -> ! f a 9functor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. 9 takes an explicit 0 of applications of t( to itself and rolls it back up into an  t. 9 = 3 ;  :functor-combinators$The "forward" function representing splittingChain1E. Provided here as a separate function because it does not require & f.()*+,-0./123456789:(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq%;functor-combinatorsAny ) t f is a  t and a D t i, if we have ( t ij. This newtype wrapper witnesses that fact. We require a newtype wrapper to avoid overlapping instances.>functor-combinators9A newtype wrapper meant to be used to define polymorphic D$ instances. See documentation for D for more information.)Please do not ever define an instance of D! "naked" on the third parameter: )instance MonidIn (WrapHBF t) (WrapF i) f -As that would globally ruin everything using .Afunctor-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 A.Bfunctor-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 | (u) :: (a, [a]) -> g a.Cfunctor-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 `s :: [a] -> Maybe (g a).Note that because tM cannot be inferred from the input or output type, you should use this with -XTypeApplications: C @ ::   f a -> (U :+: v f) a )Note that you can recursively "unroll" a ) completely into a t by using u.Dfunctor-combinators=This class effectively gives us a way to generate a value of f a based on an i a, for ( t iU. Having this ability makes a lot of interesting functions possible when used with  from ^ that weren't possible without it: it gives us a "base case" for recursion in a lot of cases.Essentially, we get an i ~> f, E, where we can introduce an f a as long as we have an i a.Formally, if we have ( t i, we are enriching the category of endofunctors with monoid structure, turning it into a monoidal category. Different choices of t$ give different monoidal categories. A functor fF is known as a "monoid in the (monoidal) category of endofunctors on t " if we can :  t f f ~> f  and also E: i ~> f pThis gives us a few interesting results in category theory, which you can stil reading about if you don't care:All6 functors are monoids in the monoidal category on GThe class of functors that are monoids in the monoidal category on 3 is exactly the functors that are instances of B.GThe class of functors that are monoids in the monoidal category on 3 is exactly the functors that are instances of '.GThe class of functors that are monoids in the monoidal category on 3 is exactly the functors that are instances of *.This is the meaning behind the common adage, "monads are just monoids in the category of endofunctors". It means that if you enrich the category of endofunctors to be monoidal with , then the class of functors that are monoids in that monoidal category are exactly what monads are. However, the adage is a little misleading: there are many other ways to enrich the category of endofunctors to be monoidal, and } is just one of them. Similarly, the class of functors that are monoids in the category of endofunctors enriched by  are '.&Note that instances of this class are intended to be written with t and i$ to be fixed type constructors, and f to be allowed to vary freely: -instance Monad f => MonoidIn Comp Identity f Any other sort of instance and it's easy to run into problems with type inference. If you want to write an instance that's "polymorphic" on tensor choice, use the  and >^ newtype wrappers over type variables, where the third argument also uses a type constructor: 8instance MonoidIn (WrapHBF t) (WrapF i) (MyFunctor t i) 5This will prevent problems with overloaded instances.Efunctor-combinatorsIf we have an i, we can generate an f! based on how it interacts with t.+Specialized (and simplified), this type is: E @ :: ' f => U a -> f a -- 1 pureT @ :: *" f => Identity a -> f a -- + pureT @() :: B f => N a -> f a -- b 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) Along with , this function makes fB a monoid in the category of endofunctors with respect to tensor t.Ffunctor-combinatorsf is isomorphic to t f i : that is, i is the identity of t, and leaves f unchanged.Gfunctor-combinatorsg is isomorphic to t i g : that is, i is the identity of t, and leaves g unchanged.Hfunctor-combinatorsG (* and ,) for  actually does not require &$. This is the more general version.Ifunctor-combinatorsF (+ and -) for  actually does not require &$. This is the more general version.Jfunctor-combinatorsG (* and ,) for  actually does not require &$. This is the more general version.Kfunctor-combinatorsF (+ and -) for  actually does not require &$. This is the more general version.Lfunctor-combinatorsA poly-kinded version of R for .Mfunctor-combinatorsA poly-kinded version of S for .Nfunctor-combinatorsAn implementation of ! that works for any instance of D t i for ) t.>Can be useful as a default implementation if you already have D implemented.Ofunctor-combinatorsAn implementation of ! that works for any instance of D t i for ) t.>Can be useful as a default implementation if you already have D implemented.Pfunctor-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 ;.Qfunctor-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 ;.Rfunctor-combinatorsConvenient wrapper over ,. that lets us drop one of the arguments of a (> for free, without requiring any extra constraints (like for ).See L% for a version that does not require & f, specifically for .Sfunctor-combinatorsConvenient wrapper over -. that lets us drop one of the arguments of a (8 for free, without requiring any constraints (like for ).See M% for a version that does not require & g, specifically for .Tfunctor-combinatorsAn  t f is isomorphic to an f consed with an ) t f, like how a g a is isomorphic to (a, [a]).Ufunctor-combinatorsAn ) t f) is isomorphic to either the empty case (i) or the non-empty case ( t f ), like how [a] is isomorphic to # (g a).Zfunctor-combinators]functor-combinatorsafunctor-combinators Instances of ** are monoids in the monoidal category on .jThis instance is the "proof" that "monads are the monoids in the category of endofunctors (enriched with )":Note that because of typeclass constraints, this requires ) as well as **. But, you can get a "local" instance of 5 for any * using vw.cfunctor-combinators5All functors are monoids in the monoidal category on z.dfunctor-combinators5All functors are monoids in the monoidal category on .efunctor-combinators Instances of ) are monoids in the monoidal category on .ffunctor-combinators Instances of 48 are monoids in the monoidal category on contravariant r.:Note that because of typeclass constraints, this requires t as well as 4*. But, you can get a "local" instance of t for any 4 using vx.gfunctor-combinators Instances of '8 are monoids in the monoidal category on the covariant .:Note that because of typeclass constraints, this requires 5 as well as '*. But, you can get a "local" instance of 5 for any ' using vy.hfunctor-combinators Instances of B* are monoids in the monoidal category on {.ifunctor-combinators Instances of B* are monoids in the monoidal category on .lfunctor-combinatorsmfunctor-combinators Instances of ) are monoids in the monoidal category on .yfunctor-combinatorszfunctor-combinators)()*+,-0./12345;<=>?@ABCDEFGHIJKLMNOPQRSTU)()*+,-0./12FGHIJKDE345NOPQRSLM>?@;<=ABCTU(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqLfunctor-combinatorsA type  t9 is supposed to represent the successive application of ts to itself. The type 0 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 9 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 0 of applications of t to itself.  = 4  functor-combinators0 is a semigroup with respect to t/: we can "combine" them in an associative way.This is essentially , but only requiring  t: it comes from the fact that 0 t is the "free  t".functor-combinators#Convert a tensor value pairing two fs into a two-item -. An analogue of 1.functor-combinatorsCreate a singleton chain.functor-combinatorsA 0 is "one or more linked f s", and a - is "zero or more linked fs". So, we can convert from a 0 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 i 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 7 and 8 to convert between the two.functor-combinatorsA 0 t f$ is like a non-empty linked list of f s, and a - t i 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-combinatorsA - t i f is a linked list of f s, and a 0 t f is a non-empty linked list of f$s. This witnesses the fact that a - t i f is either empty (i) or non-empty (0 t f).functor-combinators$The "reverse" function representing E. Provided here as a separate function because it does not require & f.functor-combinators- () NK is the free "monoid in the monoidal category of endofunctors enriched by " --- aka, the free B.functor-combinators- () NK is the free "monoid in the monoidal category of endofunctors enriched by " --- aka, the free B.functor-combinators-  UK is the free "monoid in the monoidal category of endofunctors enriched by " --- aka, the free *.functor-combinators-  z{K is the free "monoid in the monoidal category of endofunctors enriched by " --- aka, the free .functor-combinatorsfunctor-combinators- r NY is the free "monoid in the monoidal category of endofunctors enriched by contravariant r" --- aka, the free 4.functor-combinatorsfunctor-combinators-  UK is the free "monoid in the monoidal category of endofunctors enriched by " --- aka, the free '.functor-combinators- t i is the "free D t i". However, we have to wrap t in  and i in >" to prevent overlapping instances.functor-combinatorsWe have to wrap t in " to prevent overlapping instances.functor-combinators!We can collapse and interpret an - t i if we have ( t.functor-combinators0 T is the free "semigroup in the semigroupoidal category of endofunctors enriched by " --- aka, the free .functor-combinators0 rT is the free "semigroup in the semigroupoidal category of endofunctors enriched by r" --- aka, the free t.functor-combinators0 {T is the free "semigroup in the semigroupoidal category of endofunctors enriched by {" --- aka, the free F.functor-combinators0 ()T is the free "semigroup in the semigroupoidal category of endofunctors enriched by " --- aka, the free F.functor-combinators0 T is the free "semigroup in the semigroupoidal category of endofunctors enriched by " --- aka, the free ).functor-combinators0 T is the free "semigroup in the semigroupoidal category of endofunctors enriched by " --- aka, the free 5.functor-combinators0 t is the "free  t". However, we have to wrap t in " to prevent overlapping instances.-/.0123456789:;6789:-/.89786:;012349756:None,%&',-./1245678;=>?@ACEHMPSUVX_fgkq%'functor-combinators Match on a &> to get the head and the rest of the items. Analogous to the < constructor.functor-combinatorsMatch on an "empty" %; contains no f4s, but only the terminal value. Analogous to the ? constructor.functor-combinatorsMatch on a non-empty %K; contains the splitting function, the two rejoining functions, the first f/, and the rest of the chain. Analogous to the @ constructor.functor-combinators6In the covariant direction, we can interpret out of a 0 of  into any F.functor-combinators:In the contravariant direction, we can interpret out of a 0 of  into any .functor-combinators Extract the > part out of a %, shedding the covariant bits.functor-combinators Extract the < part out of a &, shedding the covariant bits.functor-combinators6In the covariant direction, we can interpret out of a - of  into any B.functor-combinators:In the contravariant direction, we can interpret out of a - of  into any .functor-combinators Extract the U part out of a %#, shedding the contravariant bits.functor-combinators Extract the U part out of a %#, shedding the contravariant bits. This version does not require a & constraint because it converts to the coyoneda-wrapped product, which is more accurately the true conversion to a covariant chain.functor-combinators Extract the d part out of a &#, shedding the contravariant bits.functor-combinators Extract the d part out of a &#, shedding the contravariant bits. This version does not require a & constraint because it converts to the coyoneda-wrapped product, which is more accurately the true conversion to a covariant chain.functor-combinatorsInvariantly combine two %s. Analogous to <|> and I. If there was some typeclass that represented semigroups on invariant ., this would be the method of that typeclass.The identity of this is .functor-combinatorsConvenient wrapper over - that simply combines the two options in an <. Analogous to <|> and .functor-combinatorsInvariantly combine two &s. Analogous to <|> and I. If there was some typeclass that represented semigroups on invariant ., this would be the method of that typeclass.functor-combinatorsConvenient wrapper over - that simply combines the two options in an <. Analogous to <|> and .functor-combinators!Convenient wrapper to build up a % on by providing each component of it. This makes it much easier to build up longer chains because you would only need to write the splitting/joining functions in one place.#For example, if you had a data type .data MyType = MTI Int | MTB Bool | MTS String and an invariant functor Prim4 (representing, say, a bidirectional parser, where Prim Int" is a bidirectional parser for an x9), then you could assemble a bidirectional parser for a MyType@ using: invmap (case MTI x -> Z (I x); MTB y -> S (Z (I y)); MTS z -> S (S (Z (I z)))) (case Z (I x) -> MTI x; S (Z (I y)) -> MTB y; S (S (Z (I z))) -> MTS z) $ assembleNightChain $ intPrim :* boolPrim :* stringPrim :* Nil CSome notes on usefulness depending on how many components you have:If you have 0 components, use  directly.If you have 1 component, use ; or  directly.If you have 2 components, use 1 or .If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off eithers one-by-one.functor-combinators A version of # where each component is itself a %. vassembleNightChain (x :* y :* z :* Nil) = concatNightChain (injectChain x :* injectChain y :* injectChain z :* Nil) functor-combinators A version of  but for &W instead. Can be useful if you intend on interpreting it into something with only a  or F instance, but no k| or B or }~.functor-combinators A version of  but for &W instead. Can be useful if you intend on interpreting it into something with only a  or F instance, but no k| or B or }~.%&%&(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkqsfunctor-combinators Match on a *> to get the head and the rest of the items. Analogous to the v constructor.functor-combinatorsMatch on an "empty" '; contains no f/s, but only the terminal value. Analogous to s.functor-combinatorsMatch on a non-empty '; contains no f3s, but only the terminal value. Analogous to the   constructor.functor-combinators"Interpret the covariant part of a } into a target context h,, as long as the context is an instance of 5. The 51 is used to combine results back together using L.functor-combinators&Interpret the contravariant part of a } into a target context h+, as long as the context is an instance of t. The t? is used to split up the input to pass to each of the actions.functor-combinators6In the covariant direction, we can interpret out of a 0 of } into any 5.functor-combinators:In the contravariant direction, we can interpret out of a 0 of } into any t.functor-combinators6In the covariant direction, we can interpret out of a - of } into any '.functor-combinators:In the contravariant direction, we can interpret out of a - of } into any 4.functor-combinators Extract the   part out of a '#, shedding the contravariant bits.functor-combinators Extract the v part out of a *#, shedding the contravariant bits.functor-combinators Extract the D part out of a ', shedding the covariant bits.functor-combinators Extract the A part out of a *, shedding the covariant bits.functor-combinatorsInvariantly combine two 's. Analogous to ~ and uI. If there was some typeclass that represented semigroups on invariant }., this would be the method of that typeclass.The identity of this is .functor-combinatorsConvenient wrapper over A that simply combines the two options in a tuple. Analogous to v.functor-combinatorsInvariantly combine two *s. Analogous to ~ and uI. If there was some typeclass that represented semigroups on invariant }., this would be the method of that typeclass.functor-combinatorsConvenient wrapper over A that simply combines the two options in a tuple. Analogous to v.functor-combinators!Convenient wrapper to build up a ' by providing each component of it. This makes it much easier to build up longer chains because you would only need to write the splitting/joining functions in one place.#For example, if you had a data type !data MyType = MT Int Bool String and an invariant functor Prim4 (representing, say, a bidirectional parser, where Prim Int" is a bidirectional parser for an x9), then you could assemble a bidirectional parser for a MyType@ using: invmap ((MyType x y z) -> I x :* I y :* I z :* Nil) ((I x :* I y :* I z :* Nil) -> MyType x y z) $ assembleDayChain $ intPrim :* boolPrim :* stringPrim :* Nil CSome notes on usefulness depending on how many components you have:If you have 0 components, use  directly.If you have 1 component, use ; or  directly.If you have 2 components, use 1 or .If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off tuples one-by-one.functor-combinators A version of # where each component is itself a '. rassembleDayChain (x :* y :* z :* Nil) = concatDayChain (injectChain x :* injectChain y :* injectChain z :* Nil) functor-combinators A version of  but for *W instead. Can be useful if you intend on interpreting it into something with only a t or 5 instance, but no 4 or '.functor-combinators A version of  but for *W instead. Can be useful if you intend on interpreting it into something with only a t or 5 instance, but no 4 or '.functor-combinators A version of  using  from vinyl instead of  from sop-cored. This can be more convenient because it doesn't require manual unwrapping/wrapping of components. data MyType = MT Int Bool String invmap ((MyType x y z) -> x ::& y ::& z ::& RNil) ((x ::& y ::& z ::& RNil) -> MyType x y z) $ assembleDayChainRec $ intPrim :& boolPrim :& stringPrim :& Nil functor-combinators A version of  using  from vinyl instead of  from sop-cored. This can be more convenient because it doesn't require manual unwrapping/wrapping of components.functor-combinators A version of  using  from vinyl instead of  from sop-cored. This can be more convenient because it doesn't require manual unwrapping/wrapping of components.functor-combinators A version of  using  from vinyl instead of  from sop-cored. This can be more convenient because it doesn't require manual unwrapping/wrapping of components.'()*+,"'()*+,(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq/functor-combinators)Convenient helper function to build up a 4+ by splitting input across many different f a%s. Most useful when used alongside 9: Jdsum [ contramap get1 x , contramap get2 y , contramap get3 z ] functor-combinators)Convenient helper function to build up a y by providing each component of it. This makes it much easier to build up longer chains as opposed to nested calls to . and manually peeling off eithers one-by-one.#For example, if you had a data type .data MyType = MTI Int | MTB Bool | MTS String and a contravariant consumer Builder8 (representing, say, a way to serialize an item, where intBuilder :: Builder Int is a serializer of x+s), then you could assemble a serializer a MyType using: contramap (case MTI x -> Z (I x); MTB y -> S (Z (I y)); MTS z -> S (S (Z (I z)))) $ concludeN $ intBuilder :* boolBuilder :* stringBuilder :* Nil CSome notes on usefulness depending on how many components you have:If you have 0 components, use .If you have 1 component, use ; directly.If you have 2 components, use  directly.If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off eithers one-by-one.functor-combinators A version of  that works for non-empty 'SOP.NP'/'SOP.NS', and so only requires a  constraint.  %&"jx   &UVWdef      !:;<=>?@AEF   vwxy()*+,-0./1234DELMPQRSکj  :;EF   ()*+,-0./12DE34PQRS UVWdef vwxyx " !    &LM%&%   ?@A<=>x(c) Justin Le 2019BSD3 justin@jle.im experimental non-portableNone,%&',-./1245678;=>?@ACEHMPSUVX_fgkq03functor-combinatorsIf tA is a contravariant functor combinator, then you applying it to  a f gives you a profunctor.functor-combinatorsIf t= is a covariant functor combinator, then you applying it to  a f gives you a profunctor.functor-combinators*Turn the contravariant functor combinator t into an i functor combinator; if t f a "consumes" as, then  t f a will both consume and produce as.*You can run this normally as if it were a t f a by using A; however, you can also interpret into covariant contexts with , , and .See  for more information.functor-combinators&Turn the covariant functor combinator t into an i functor combinator; if t f a "produces" as, then  t f a will both consume and produce as.*You can run this normally as if it were a t f a by using A; however, you can also interpret into covariant contexts with , , and .See  for more information.functor-combinatorszA useful helper type to use with a contravariant functor combinator that allows you to tag along covariant access to all fs inside the combinator.)Maybe most usefully, it can be used with Dec. Remember that Dec f a is a collection of f x3s, with each x existentially wrapped. Now, for a Dec (Post a f) a, it will be a collection of f x and x -> a]s: not only each individual part, but a way to "re-embed" that individual part into overal a.So, you can imagine Dec ( a f) b as a collection of f x that consumes b and produces a.When a and b are the same, Dec ( a f) a> is like the free invariant sequencer. That is, in a sense, Dec ( a f) aD contains both contravariant and covariant sequences side-by-side,  consuming a s and also  producing as.#You can build up these values with *, and then use whatever typeclasses your t) normally supports to build it up, like  (for DivR). You can then interpret it into both its contravariant and covariant contexts: 0-- interpret the covariant part runCovariant :: B g => (f ~> g) -> Div (Post a f) a -> g a runCovariant f = interpret (f . getPost) -- interpret the contravariant part runContravariant :: J g => (f ~> g) -> Div (Post a f) a -> g a runContravariant = preDivisible The  type wraps up Dec ( a f) a into a type  Dec f a, with nice instances/helpers.UAn example of a usage of this in the real world is a possible implementation of the unjsonV library's sum type constructor, to implement bidrectional serializers for sum types.functor-combinatorszA useful helper type to use with a covariant functor combinator that allows you to tag along contravariant access to all fs inside the combinator.)Maybe most usefully, it can be used with Ap. Remember that Ap f a is a collection of f x3s, with each x existentially wrapped. Now, for a Ap (Pre a f) a, it will be a collection of f x and a -> x_s: not only each individual part, but a way to "select" that individual part from the overal a.So, you can imagine Ap ( a f) b as a collection of f x that consumes a and produces b.When a and b are the same, Ap ( a f) a> is like the free invariant sequencer. That is, in a sense, Ap ( a f) aD contains both contravariant and covariant sequences side-by-side,  consuming a s and also  producing as.#You can build up these values with *, and then use whatever typeclasses your t) normally supports to build it up, like ' (for ApR). You can then interpret it into both its contravariant and covariant contexts: 0-- interpret the covariant part runCovariant :: ' g => (f ~> g) -> Ap (Pre a f) a -> g a runCovariant f = interpret (f . getPre) -- interpret the contravariant part runContravariant :: 4H g => (f ~> g) -> Ap (Pre a f) a -> g a runContravariant = preDivisible The  type wraps up Ap ( a f) a into a type  Ap f a, with nice instances/helpers.7An example of a usage of this in the real world is the unjson^ library's record type constructor, to implement bidrectional serializers for product types.functor-combinatorsRun a  t into a contravariant 4 context. To run it in t s normal covariant context, use .IThis will work for types where there are a possibly-empty collection of fs, like: 1preDivisibleT :: Divisible g => (f ~> g) -> PreT Ap< f ~> g preDivisibleT :: Divisible g => (f ~> g) -> PreT ListF f ~> g functor-combinatorsRun a  t into a contravariant t context. To run it in t s normal covariant context, use .CThis will work for types where there is a non-empty collection of fs, like: +preDiviseT :: Divise g => (f ~> g) -> PreT Ap19 f ~> g preDiviseT :: Divise g => (f ~> g) -> PreT  NonEmptyF f ~> g functor-combinatorsRun a  t into a M. To run it in t s normal covariant context, use .4This will work for types where there is exactly one f inside: 9preContravariantT :: Contravariant g => (f ~> g) -> PreT StepE f ~> g preContravariantT :: Contravariant g => (f ~> g) -> PreT Coyoneda f ~> g functor-combinatorsRun a "pre-routed" t into a contravariant 4 context. To run it in t s normal covariant context, use  with .IThis will work for types where there are a possibly-empty collection of fs, like: +preDivisible :: Divisible g => (f ~> g) -> Ap (: a f) b -> g a preDivisible :: Divisible g => (f ~> g) -> ListF ( a f) b -> g a functor-combinatorsRun a "pre-routed" t into a contravariant t context. To run it in t s normal covariant context, use  with .GThis will work for types where there are is a non-empty collection of fs, like: %preDivise :: Divise g => (f ~> g) -> Ap1 (4 a f) b -> g a preDivise :: Divise g => (f ~> g) ->  NonEmptyF ( a f) b -> g a functor-combinatorsRun a "pre-routed" t into a M. To run it in t!s normal covariant context, use  with .4This will work for types where there is exactly one f inside: 3preContravariant :: Contravariant g => (f ~> g) -> Step (B a f) b -> g a preContravariant :: Contravariant g => (f ~> g) -> Coyoneda ( a f) b -> g a functor-combinatorsRun a  t into a covariant B context. To run it in t$s normal contravariant context, use .IThis will work for types where there are a possibly-empty collection of fs, like: (postPlusT :: Plus g => (f ~> g) -> PreT Dec0 f ~> g postPlusT :: Plus g => (f ~> g) -> PreT Div f ~> g functor-combinatorsRun a  t into a covariant F context. To run it in t$s normal contravariant context, use .CThis will work for types where there is a non-empty collection of fs, like: &postAltT :: Alt g => (f ~> g) -> PreT Dec1. f ~> g postAltT :: Alt g => (f ~> g) -> PreT Div1 f ~> g functor-combinatorsRun a  t into a covariant & context. To run it in t$s normal contravariant context, use .4This will work for types where there is exactly one f inside: .postFunctorT :: Functor g => (f ~> g) -> PreT Step6 f ~> g postFunctorT :: Functor g => (f ~> g) -> PreT  f ~> g functor-combinatorsRun a "post-routed" t into a covariant B context. To run it in t$s normal contravariant context, use .IThis will work for types where there are a possibly-empty collection of fs, like: "postPlus :: Plus g => (f ~> g) -> Dec7 (Post a f) b -> g a postPlus :: Plus g => (f ~> g) -> Div (Post a f) b -> g a functor-combinatorsRun a "post-routed" t into a covariant F context. To run it in t$s normal contravariant context, use .GThis will work for types where there are is a non-empty collection of fs, like:  postAlt :: Alt g => (f ~> g) -> Dec15 (Post a f) b -> g a postAlt :: Alt g => (f ~> g) -> Div1 (Post a f) b -> g a functor-combinatorsRun a "post-routed" t into a covariant & context. To run it in t$s normal contravariant context, use .4This will work for types where there is exactly one f inside: (postFunctor :: Functor g => (f ~> g) -> StepE (Post a f) b -> g a postFunctor :: Functor g => (f ~> g) ->  (Post a f) b -> g a functor-combinatorsContravariantly retract the f out of a G, applying the pre-routing function. Not usually that useful because % is meant to be used with covariant &s.functor-combinators Interpret a B into a contravariant context, applying the pre-routing function.functor-combinatorsHDrop the pre-routing function and just give the original wrapped value.functor-combinators(Pre-compose on the pre-routing function.functor-combinatorsLike ;5, but allowing you to provide a pre-routing function.functor-combinatorsCovariantly retract the f out of a H, applying the post-routing function. Not usually that useful because ) is meant to be used with contravariant &s.functor-combinators Interpret a ? into a covariant context, applying the post-routing function.functor-combinatorsIDrop the post-routing function and just give the original wrapped value.functor-combinators*Post-compose on the post-routing function.functor-combinatorsLike ;6, but allowing you to provide a post-routing function.functor-combinators"This instance is over-contrained (aV only needs to be uninhabited), but there is no commonly used "uninhabited" typeclassfunctor-combinators"This instance is over-contrained (aV only needs to be uninhabited), but there is no commonly used "uninhabited" typeclass functor-combinators functor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinatorsfunctor-combinators functor-combinators!functor-combinators"functor-combinators  44010189898RSZ<Z<4444Y!!Y      !"#$%&'()*+,-./01234m56789:;<=>?@ABCDEFGHIJKLMNOPQywRSxTddUVWXYZ[\]^_`abeecdefghijklmnopqrstuvwxyz{|}~                                                                                            ! " # $ % & ' ( ) * + , - . / 0 1 6 6 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L L M N N O P Q R S T U V W X Y Z [ \ ] ^ _ N N O ` a b c d Q R W X Y Z S T U [=e=f=g==h=i=j=$=k=A=l m m n o p q r s t u v w x y z { { | } ~                       >     7                                                                                               %&      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ K 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 uQvQwQxQxQyQzQ{Q|QtQ}Q~QiQQQQQQQQQQQXXUWWTTVV      !!"#$%^&'()*+,Q-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdpephpWpXpYpZpfpgphpipjpkplpmpnpopppqprsstuuvwxyz{|}~jwz      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXVWYZ[Z\]^_BZ`ZaZbcdefghgiZjZkZlmkl^_]mknmkoZpqrZstuvuwuxmk|yzZ~^+,{|}~HtF^VWVWtE{|VZq./ZT^===bc==========^+ZVZZaqQQQvQQQ<R_ZVWVWF<Z2functor-combinators-0.3.4.1-3MefywMGUE8LgOXQMxr68vData.Functor.CombinatorControl.Natural.IsoFControl.Monad.Freer.Church!Data.Functor.Contravariant.Divise!Data.Functor.Contravariant.Decide#Data.Functor.Contravariant.ConcludeData.Functor.Combinator.UnsafeControl.Applicative.StepControl.Applicative.ListF Data.Functor.Contravariant.NightData.Functor.Invariant.NightData.HBifunctor Data.HFunctorData.HFunctor.Interpret"Data.Functor.Invariant.Night.Chain Data.Functor.Invariant.Day.ChainData.HFunctor.Chain)Data.Functor.Contravariant.Divisible.FreeData.Functor.Apply.FreeData.HFunctor.FinalData.HBifunctor.AssociativeData.HBifunctor.TensorData.HFunctor.RouteData.Functor.Tensor HBifunctorMonoidalData.Functor.ComposeComposeData.Functor.HFunctorinject interpretControl.Monad.FreeFreeControl.Monad.Free.ChurchFHFunctor Interpretretract splittingSFSFMFsplitSFData.Functor.PlusPlusupgradeC Data.ProxyProxyControl.Comonad.Trans.EnvEnvTMMapData.Functor.TheseTheseTNEMapFHLiftControl.Monad.Trans.Identity IdentityTControl.COmonad.Trans.Env Data.FunctorDayData.HFunctor.InternalInjectControl.Monad.MorphMFunctor generalizeBindMMonadData.SemigroupAnySumNumeric.NaturalNaturalControl.Monad.Fail MonadFail Control.Monad MonadPlusData.Bifunctors.JokerJoker Data.TaggedTaggedData.HFunctor.Chain.InternalControl.Applicative.FreeApDivDecAp1Div1Dec1CompData.Functor.DayData.Functor.BindData.Functor.ApplyApply AssociativePureData.List.NonEmptyNonEmptyData.Functor.IdentityIdentityStepStepsControl.Applicative.Backwards BackwardsListByChain1unrollNE$Data.Functor.Contravariant.Divisible DivisibleConcludeData.Map Data.MonoidData.HBifunctor.Tensor.Internal Data.ListunconsnonEmptyChainunrollLBData.Functor.Combinators.Unsafe unsafeBind unsafeDivise unsafeApplyNRefutec DecidableControl.Applicative AlternativeCCYCoyonedabase GHC.GenericsV1:+::*:R1L1$comonad-5.0.6-JfcN6iPhxp7Eeulcp61Z8ttransformers-0.5.5.0 runIdentityT!free-5.1.3-AbI9ePKaMIuFyY5JHdkL05Control.Alternative.FreeAlt)kan-extensions-5.2-EPYu3pXPyoBHuVnLTsS7GvData.Functor.Coyoneda#mmorph-1.1.3-CrbW1pkoojp2congoTX0Y2Control.Monad.Trans.Compose getComposeTComposeTControl.Monad.Trans.ReaderReaderT runReaderT1natural-transformation-0.4-GetNVh5YZQM5wKeIcPYC4hControl.Natural~>#these-1.1.1.1-7npddKJRNa7VbtjVrHOLeThese1That1This1Control.Applicative.LiftLift:>>=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 $fFunctorComp<~>isoFcoercedFviewFreviewFoverFfromFWrappedDivisible WrapDivisibleunwrapDivisibleDivisedivisedivised<:>dsum1$fDiviseReverse$fDiviseProduct$fDiviseCompose$fDiviseWriterT$fDiviseWriterT0$fDiviseStateT$fDiviseStateT0 $fDiviseRWST $fDiviseRWST0$fDiviseReaderT$fDiviseMaybeT $fDiviseListT$fDiviseIdentityT$fDiviseExceptT$fDiviseErrorT$fDiviseBackwards $fDivise:.: $fDivise:*: $fDiviseM1 $fDiviseRec1 $fDiviseV1 $fDiviseU1 $fDiviseAlt $fDiviseProxy$fDivisePredicate$fDiviseEquivalence$fDiviseComparison$fDiviseConstant $fDiviseConst $fDiviseOp$fDiviseWrappedDivisible$fContravariantWrappedDivisibleDecidedecidedecided $fDecideProxy$fDecideReverse$fDecideProduct$fDecideCompose$fDecideWriterT$fDecideWriterT0$fDecideStateT$fDecideStateT0$fDecideMaybeT $fDecideListT $fDecideRWST $fDecideRWST0$fDecideReaderT$fDecideIdentityT$fDecideBackwards $fDecide:.: $fDecide:*: $fDecideM1 $fDecideRec1 $fDecideV1 $fDecideU1 $fDecideAlt $fDecideOp$fDecidePredicate$fDecideEquivalence$fDecideComparison$fDecideWrappedDivisibleconclude concluded$fConcludeReverse$fConcludeProduct$fConcludeCompose$fConcludeWriterT$fConcludeWriterT0$fConcludeStateT$fConcludeStateT0$fConcludeMaybeT$fConcludeListT$fConcludeRWST$fConcludeRWST0$fConcludeReaderT$fConcludeIdentityT$fConcludeBackwards $fConclude:.: $fConclude:*: $fConcludeM1$fConcludeRec1 $fConcludeU1 $fConcludeAlt$fConcludeProxy $fConcludeOp$fConcludePredicate$fConcludeEquivalence$fConcludeComparison$fConcludeWrappedDivisible unsafePlus unsafePointedunsafeConclude$fPointedPointMestepPosstepVal $fShowStep $fReadStep$fEqStep $fOrdStep $fFunctorStep$fFoldableStep$fTraversableStep $fGenericStep $fDataStep $fShow1Step $fRead1Step $fEq1StepgetStepssteppingstepDownstepUpabsurd1$fTraversable1Step$fFoldable1Step $fPointedStep$fInvariantStep$fDecidableStep$fConcludeStep $fDecideStep $fDiviseStep$fDivisibleStep$fContravariantStep$fApplicativeStep $fApplyStep $fOrd1Step $fShowSteps $fReadSteps $fEqSteps $fOrdSteps$fFunctorSteps$fFoldableSteps$fTraversableSteps$fGenericSteps $fDataSteps $fShow1Steps $fRead1Steps $fEq1StepsFlagged flaggedFlag flaggedVal steppings stepsDownstepsUp$fPointedSteps $fAltSteps$fInvariantSteps$fContravariantSteps$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$fInvariantVoid2$fContravariantVoid2 $fApplyVoid2 $fBindVoid2 $fAltVoid2$fSemigroupVoid2 $fOrd1Void2 $fShowVoid3 $fReadVoid3 $fEqVoid3 $fOrdVoid3$fFunctorVoid3$fFoldableVoid3$fTraversableVoid3$fGenericVoid3 $fDataVoid3 $fShow1Void3 $fRead1Void3 $fEq1Void3absurd3$fInvariantVoid3$fContravariantVoid3 $fApplyVoid3 $fBindVoid3 $fAltVoid3$fSemigroupVoid3 $fOrd1Void3ListFrunListF $fShowListF $fReadListF $fEqListF $fOrdListF$fFunctorListF$fFoldableListF$fTraversableListF$fGenericListF $fDataListF $fShow1ListF $fRead1ListF $fEq1ListF NonEmptyF runNonEmptyFmapListF$fDecidableListF$fConcludeListF $fDecideListF$fDivisibleListF $fDiviseListF$fInvariantListF$fContravariantListF$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$fDecideNonEmptyF$fDiviseNonEmptyF$fInvariantNonEmptyF$fContravariantNonEmptyF$fAltNonEmptyF$fApplicativeNonEmptyF$fOrd1NonEmptyF $fShowMaybeF $fReadMaybeF $fEqMaybeF $fOrdMaybeF$fFunctorMaybeF$fFoldableMaybeF$fTraversableMaybeF$fGenericMaybeF $fDataMaybeF $fShow1MaybeF $fRead1MaybeF $fEq1MaybeFMapFrunMapF mapMaybeF maybeToListF listToMaybeF$fPointedMaybeF$fMonoidMaybeF$fSemigroupMaybeF$fDecidableMaybeF$fConcludeMaybeF$fDecideMaybeF$fDivisibleMaybeF$fDiviseMaybeF$fInvariantMaybeF$fContravariantMaybeF$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 $fOrd1NEMapFNotrefuteNightnightrunNightassocunassocswappedtrans1trans2refutedintro1intro2elim1elim2$fInvariantNight$fContravariantNight$fSemigroupNot$fInvariantNot$fContravariantNot runNightAltrunNightDecide toCoNight toCoNight_ toContraNightWrappedHBifunctorWrapHBifunctorunwrapHBifunctorhlefthrighthbimaphmapabsorbProxyF overHFunctor $fShowProxyF $fReadProxyF $fEqProxyF $fOrdProxyF$fFunctorProxyF$fFoldableProxyF$fTraversableProxyF$fGenericProxyF $fDataProxyF $fShow1ProxyF $fRead1ProxyF $fEq1ProxyFConstF getConstF$fHFunctorkkProxyF$fInvariantProxyF$fDecidableProxyF$fConcludeProxyF$fDecideProxyF$fDiviseProxyF$fDivisibleProxyF$fContravariantProxyF $fOrd1ProxyF $fShowConstF $fReadConstF $fEqConstF $fOrdConstF$fFunctorConstF$fFoldableConstF$fTraversableConstF$fGenericConstF $fDataConstF $fShow1ConstF $fRead1ConstF $fEq1ConstFHBindhbindhjoinHFreeHReturnHJoinHPureHOther retractHLift foldHFree retractHFree injectMapinjectContramap$fHFunctorkkConstF$fInvariantConstF$fDiviseConstF$fDivisibleConstF$fContravariantConstF $fOrd1ConstF$fInvariantHLift$fContravariantHLift$fHFunctorkkHLift $fOrd1HLift $fEq1HLift $fShow1HLift$fHFunctorkkHFree $fShowHFree $fShow1HFree$fInvariantHFree$fContravariantHFree$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 $fInjectkMapF$fInjectkNEMapF$fInjectkMaybeF$fInjectkNonEmptyF$fInjectkListF$fInjectTYPEAp1$fInjectTYPECoyoneda$fInjectTYPECoyoneda0 $fHBindkHFree $fHBindkHLift$fHBindTYPEEnvT$fHBindkProxyF$fHBindkReverse$fHBindTYPEWrappedApplicative$fHBindkBackwards$fHBindTYPEMaybeApply$fHBindTYPELift$fHBindkIdentityT $fHBindTYPEAp$fHBindTYPEAp0$fHBindTYPEFree1$fHBindTYPEFree$fHBindTYPEAlt $fHBindkM1 $fHBindkSum $fHBindk:+:$fHBindTYPEProduct$fHBindTYPE:*:$fHBindTYPEThese1$fHBindkFlagged $fHBindkStep$fHBindkMaybeF$fHBindkNonEmptyF $fHBindkListF$fHBindTYPEAp1$fHBindTYPECoyoneda$fFunctorHLift$fFunctorHFree $fOrdHLift $fEqHLift $fReadHLift $fShowHLiftWrapHFunwrapHFAndCAltConst getAltConstforIigetgetIicollectcollectI icollect1iapplyifanoutifanout1$fInterpretkHFreef$fInterpretkHLiftf$fInterpretTYPEComposeTf$fInterpretkReversef$fInterpretTYPEEnvTf$fInterpretTYPEReaderTf"$fInterpretTYPEWrappedApplicativef$fInterpretkBackwardsf$fInterpretTYPEMaybeApplyf$fInterpretTYPELiftf$fInterpretkIdentityTf$fInterpretTYPEApf$fInterpretTYPEApf0$fInterpretTYPEFree1f$fInterpretTYPEFreef$fInterpretkM1f$fInterpretTYPESumf$fInterpretTYPE:+:f$fInterpretTYPEProductf$fInterpretTYPE:*:f$fInterpretTYPEAltf$fInterpretTYPEThese1f$fInterpretkFlaggedf$fInterpretTYPEStepsf$fInterpretkStepf$fInterpretTYPENEMapFf$fInterpretTYPEMapFf$fInterpretTYPEMaybeFf$fInterpretTYPENonEmptyFf$fInterpretTYPEListFf$fInterpretTYPEApf1$fInterpretTYPECoyonedaf$fInterpretTYPECoyonedaf0$fConcludeAltConst$fDecideAltConst$fDivisibleAltConst$fDiviseAltConst$fPlusAltConst $fAltAltConst$fApplicativeAltConst$fApplyAltConst$fInvariantAltConst$fContravariantAltConst$fOrd1AltConst $fEq1AltConst$fShow1AltConst $fAndCkcda$fHBindkWrapHF$fInjectkWrapHF$fHFunctorkkWrapHF $fOrd1WrapHF $fEq1WrapHF $fShow1WrapHF$fShowAltConst $fEqAltConst $fOrdAltConst$fGenericAltConst$fFunctorAltConst$fFoldableAltConst$fTraversableAltConst$fDataAltConst $fShowWrapHF $fReadWrapHF $fEqWrapHF $fOrdWrapHF$fFunctorWrapHF$fFoldableWrapHF$fTraversableWrapHF$fGenericWrapHF $fDataWrapHFLeftFrunLeftFoverHBifunctor $fShowLeftF $fReadLeftF $fEqLeftF $fOrdLeftF$fFunctorLeftF$fFoldableLeftF$fTraversableLeftF$fGenericLeftF $fDataLeftF $fShow1LeftF $fRead1LeftF $fEq1LeftF $fOrd1LeftF$fBifunctorLeftF$fBifoldableLeftFRightF runRightF$fHBifunctorkLeftF$fBiapplicativeLeftF$fBitraversableLeftF $fShowRightF $fReadRightF $fEqRightF $fOrdRightF$fFunctorRightF$fFoldableRightF$fTraversableRightF$fGenericRightF $fDataRightF$fHFunctorLeftF $fShow1RightF $fRead1RightF $fEq1RightF$fInterpretkRightFf$fHBindkRightF$fInjectkRightF$fHFunctorkkRightF$fHBifunctorkRightF $fOrd1RightF$fHFunctorRightF NightChain NightChain1DayChain unDayChain DayChain1 DayChain1_ unDayChain1DoneMoreDone1More1 foldChain1 unfoldChain1toChain1 injectChain1 matchChain1 foldChain unfoldChainsplittingChain unconsChainLoseChooseunDiv1unDivDiv1_DivideConquerdivListFlistFDivhoistDivliftDivrunDivtoDiv hoistDiv1liftDiv1runDiv1 div1NonEmptyF nonEmptyFDiv1hoistDecliftDecrunDectoDec hoistDec1liftDec1runDec1$fInterpretTYPEDivf$fInvariantDiv$fInterpretTYPEDiv1f$fInvariantDiv1$fInterpretTYPEDecf$fInjectTYPEDec$fHFunctorTYPETYPEDec $fConcludeDec $fDecideDec$fInvariantDec$fContravariantDec$fInterpretTYPEDec1f$fInjectTYPEDec1$fHFunctorTYPETYPEDec1 $fDecideDec1$fInvariantDec1$fContravariantDec1$fContravariantDiv $fDiviseDiv$fDivisibleDiv $fHFunctorDiv $fInjectDiv$fContravariantDiv1 $fDiviseDiv1$fHFunctorDiv1 $fInjectDiv1DayAp1ap1DaytoApfromApliftAp1 retractAp1runAp1$fInterpretTYPEAp1f$fHFunctorTYPETYPEAp1 $fApplyAp1$fInvariantAp1 $fFunctorAp1FreeOf FreeFunctorByfromFreeFinalrunFinal liftFinal0 liftFinal1 liftFinal2 hoistFinalCtoFinal fromFinal finalizing$fInterpretkFinalf$fInjectkFinal$fHFunctorkkFinal$fInvariantFinal$fDecidableFinal$fConcludeFinal $fDecideFinal$fDivisibleFinal$fContravariantFinal$fConcludeFinal0$fDecideFinal0$fContravariantFinal0$fDecideFinal1$fContravariantFinal1$fDivisibleFinal0 $fDiviseFinal$fContravariantFinal2$fDiviseFinal0$fContravariantFinal3$fContravariantFinal4 $fPlusFinal $fAltFinal$fFunctorFinal $fAltFinal0$fFunctorFinal0$fMonadReaderrFinal $fMonadFinal $fApplyFinal$fApplicativeFinal$fFunctorFinal1$fPointedFinal$fMonadPlusFinal$fAlternativeFinal $fPlusFinal0 $fAltFinal1 $fMonadFinal0$fApplicativeFinal0$fFunctorFinal2 $fMonadFinal1$fApplicativeFinal1 $fApplyFinal0$fFunctorFinal3$fAlternativeFinal0 $fPlusFinal1 $fAltFinal2$fApplicativeFinal2 $fApplyFinal1$fFunctorFinal4$fApplicativeFinal3 $fApplyFinal2$fFunctorFinal5 $fBindFinal $fApplyFinal3$fFunctorFinal6 $fApplyFinal4$fFunctorFinal7$fFunctorFinal8$fFreeOfUnconstrainedIdentityT$fFreeOfConcludeDec$fFreeOfDecideDec1$fFreeOfDivisibleDiv$fFreeOfDiviseDiv1$fFreeOfPlusListF$fFreeOfAltNonEmptyF$fFreeOfPointedMaybeApply$fFreeOfPointedLift$fFreeOfBindFree1$fFreeOfMonadFree$fFreeOfAlternativeAlt$fFreeOfApplicativeAp$fFreeOfApplyAp1$fFreeOfApplicativeAp0$fFreeOfContravariantCoyoneda$fFreeOfFunctorCoyonedaWrapNEunwrapNEWrapHBF unwrapHBF SemigroupIn biretract binterpret NonEmptyBy FunctorBy associatingappendNEmatchNEconsNE toNonEmptyBydisassoc retractNE interpretNE matchingNEbiget!$!!*!!+!biapply$fAssociativeRightF$fAssociativeLeftF$fAssociativeJoker$fAssociativeComp$fAssociativeVoid3$fAssociativeThese1$fAssociativeSum$fAssociative:+:$fAssociativeNight$fAssociativeNight0$fAssociativeDay$fAssociativeDay0$fAssociativeDay1$fAssociativeProduct$fAssociative:*:$fSemigroupInRightFf$fSemigroupInLeftFf$fSemigroupInJokerf$fSemigroupInCompf$fSemigroupInVoid3f$fSemigroupInThese1f$fSemigroupInSumf$fSemigroupIn:+:f$fSemigroupInNightf$fSemigroupInDayf$fSemigroupInDayf0$fSemigroupInProductf$fSemigroupIn:*:f$fAssociativeWrapHBF$fHBifunctorkWrapHBF $fOrd1WrapHBF $fEq1WrapHBF$fShow1WrapHBF$fSemigroupInWrapHBFWrapNE$fInvariantWrapNE$fContravariantWrapNE$fFunctorWrapNE $fShowWrapHBF $fReadWrapHBF $fEqWrapHBF $fOrdWrapHBF$fFunctorWrapHBF$fFoldableWrapHBF$fTraversableWrapHBF$fGenericWrapHBF $fDataWrapHBF$fHFunctorWrapHBFTensorappendLBsplitNE splittingLBtoListByfromNEnilLBconsLBunconsLB appendChainunrollrerollrerollNE splitChain1WrapLBunwrapLBWrapFunwrapF Matchable unsplitNEmatchLBMonoidInpureT rightIdentity leftIdentitysumLeftIdentitysumRightIdentityprodLeftIdentityprodRightIdentityprodOutLprodOutR retractLB interpretLBinLinRoutLoutR splittingNE matchingLB$fTensorCompIdentity$fTensorThese1V1 $fTensorSumV1 $fTensor:+:V1$fTensorNightNot$fTensorNightNot0$fTensorDayIdentity$fTensorDayProxy$fTensorDayIdentity0$fTensorProductProxy$fTensor:*:Proxy$fMonoidInCompIdentityf$fMonoidInThese1V1f$fMonoidInSumV1f$fMonoidIn:+:V1f$fMonoidInNightNotf$fMonoidInDayProxyf$fMonoidInDayIdentityf$fMonoidInProductProxyf$fMonoidIn:*:Proxyf$fMatchableSumV1$fMatchable:+:V1$fMatchableNightNot$fMatchableDayProxy$fMatchableDayIdentity$fMatchableProductProxy$fMatchable:*:Proxy$fMatchableNightNot0$fMatchableDayIdentity0$fTensorWrapHBFWrapF $fOrd1WrapF $fEq1WrapF $fShow1WrapF$fMonoidInWrapHBFWrapFWrapLB$fSemigroupInWrapHBFWrapLB$fInvariantWrapLB$fContravariantWrapLB$fFunctorWrapLB $fShowWrapF $fReadWrapF $fEqWrapF $fOrdWrapF$fFunctorWrapF$fFoldableWrapF$fTraversableWrapF$fGenericWrapF $fDataWrapF unrollingNE appendChain1toChain injectChain fromChain1 unrollingsplittingChain1 matchingChain unmatchChain $fPlusChain $fAltChain $fPlusChain0 $fAltChain0 $fMonadChain $fBindChain$fApplicativeChain $fApplyChain$fConcludeChain $fDecideChain$fDivisibleChain $fDiviseChain$fApplicativeChain0 $fApplyChain0$fMonoidInWrapHBFWrapFChain$fSemigroupInWrapHBFChain$fInterpretTYPEChainf$fInjectTYPEChain$fDecideChain1$fDiviseChain1 $fAltChain1 $fAltChain10 $fBindChain1 $fApplyChain1$fApplyChain10$fSemigroupInWrapHBFChain1$fInterpretTYPEChain1fRejectSwerverunCoNightChain1runContraNightChain1chainDec chainDec1runCoNightChainrunContraNightChain chainListF chainListF_chainNonEmptyFchainNonEmptyF_swerveswervedswerve1swerved1assembleNightChainconcatNightChainassembleNightChain1concatNightChain1KnotGather runDayApply runDayDiviserunCoDayChain1runContraDayChain1 runCoDayChainrunContraDayChainchainApchainAp1chainDiv chainDiv1gathergatheredgather1 gathered1assembleDayChainconcatDayChainassembleDayChain1concatDayChain1assembleDayChainRecconcatDayChainRecassembleDayChain1RecconcatDayChain1Recdsum concludeNdecideNPostTunPostTPreTunPreTPost:<$>:Pre:>$<: preDivisibleT preDiviseTpreContravariantT preDivisible preDivisepreContravariant postPlusTpostAltT postFunctorTpostPluspostAlt postFunctor retractPre interpretPregetPremapPre injectPre retractPost interpretPostgetPostmapPost injectPost$fInterpretTYPEPref$fHBindTYPEPre$fInjectTYPEPre$fHFunctorTYPETYPEPre$fInvariantPre$fInterpretTYPEPostf$fHBindTYPEPost$fInjectTYPEPost$fHFunctorTYPETYPEPost$fInvariantPost$fContravariantPost$fInterpretTYPEPreTf$fInjectTYPEPreT$fHFunctorTYPETYPEPreT$fInvariantPreT$fInvariantPostT $fAltProPre $fBindProPre$fProfunctorProPre$fInvariantProPost$fFunctorProPost$fProfunctorProPost $fFunctorPre $fOrdProPre $fEqProPre $fShowProPre$fMonoidProPre$fSemigroupProPre$fInvariantProPre $fPlusProPre$fDecidableProPre$fConcludeProPre$fDecideProPre$fDiviseProPre$fDivisibleProPre$fContravariantProPre $fMonadProPre$fApplicativeProPre $fApplyProPre$fFunctorProPre GHC.MaybeMaybeghc-prim GHC.TypesIOBoolGHC.BaseFunctor Applicative:.:*semigroupoids-5.3.4-BOE7XRQwfJL9y7aFPQj73nData.Functor.Bind.ClassMonadreturn>>=GHC.ShowShowGHC.ReadReadControl.Monad.Free.Classwrap MonadFreepure.id*contravariant-1.5.2-1ZQM8SswnWXJmdlHRX0Vigconquerdivide<|>Data.Functor.Contravariant contramap SemigroupData.Semigroup.Internal Data.EitherEitherLeftRight Data.VoidVoid$pointed-5.0.1-I1hnUMGAkVv5lVJ0QnV6fz Data.PointedPointed GHC.NaturalData.Functor.AltFalseTruepoint GHC.Classes||<*> ContravariantStringJustNDLsumSumprodProd$fHFunctork[]NS$fHFunctork[]NP$fHFunctorTYPETYPEMaybeT$fHFunctorTYPETYPEF$fHFunctorTYPETYPECoyoneda$fHBifunctorTYPENight$fHBifunctorTYPEDay$fHBifunctorTYPEDay0 ndlSingletonfromNDLControl.Monad.Trans.Classlift MonadTranszeromemptyEqData.Functor.ConstConstMonoid#Data.Functor.Contravariant.Coyoneda&invariant-0.5.3-62MLq48TJWmJ4zhLQPZgisData.Functor.Invariant InvariantOp mtl-2.2.2Control.Monad.Reader.Class MonadReader$fInvariantChain1$fContravariantChain1 unNightChain NightChain1_ unNightChain1Data.Functor.Contravariant.Day1trivial-constraint-0.6.0.0-Bzax6uaD6fS3FnmR9WToSLData.Constraint.Trivial Unconstrained:|GHC.Num+ Data.FoldablelengthIntCharData.Functor.SumData.Functor.ProductProduct Data.TupleuncurryData.Functor.Invariant.DayliftA2#vinyl-0.13.0-85P9x7eT4R9ILQKoq4J8eaData.Vinyl.XRecXRec'sop-core-0.5.0.1-CJJL01S53WkJifrHVaTMB5 Data.SOP.NPNPProPostProPre