~      !"#$%&'()*+ , - . /012 3 4 5 6 7 8 9 : ; < =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !!!!""""####$$$$%%%%%%%&&&&''''(((()))))))))**+++++,,,,,,,,,,,----- - - - . ......///////////00 1!1"1#1$1%1&1'2(2)2*3+3,3-3.3/404142434445565758595:6;6<6=6>6?7@7A7B7C7D7E8F8G9H9I9J9K9L9M9N9O9PQRSTUV: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@yAzA{A|A}AA%non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com>    %non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com> A   ~  F : C -> D$ provides for every pair of objects c, c' in C  and every morphism g : F c -> F c'l in D , a morphism g' : c -> c' in C . In short , map has a right-inverse under composition.  fmap . premap = id For every pair of objects a and b in C a     ~  F : C -> D maps every morphism  f : a -> b onto a distinct morphism f : T a -> T b1 (since it is faithful) and every morphism from g : T a -> T b can be obtained from some f-. (It maps Hom-sets bijectively, or in short fmap has both ,a left and right inverse under composition.  unmap . fmap = id     portable experimentalEdward Kmett <ekmett@gmail.com>"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>   Rank-2 Types experimentalEdward Kmett <ekmett@gmail.com>  !"#$%&'  !"#$%&' "#$ !%&'  ! !"#$#$%&' portable  experimentalEdward Kmett <ekmett@gmail.com>()*()*()*())* portable experimentalEdward Kmett <ekmett@gmail.com>+,-.+,-.-.+,+,,-..portable experimentalEdward Kmett <ekmett@gmail.com>/01/01/01/0101 &non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>23232323 %non-portable (empty data declaration) experimentalEdward Kmett <ekmett@gmail.com>45454545 %non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com>6789:6789:9:678678789:: %non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com>;<;<;<;<<%non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com> =>?@ABCDE =>?@ABCDE >?@ABCDE= =>?@?@ABCBCDE&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>FGHFGHGHFFGHH"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>IJKLMNOPQRSTUVWXYZIJKLMNOPQRSTUVWXYZZYWXUVSTQROPMNKLIJIJJKLLMNNOPPQRRSTTUVVWXXYZ"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>[\]^_`abcdefghi[\]^_`abcdefghiefg`a^_ihbcd[\][\]\]^__`aabcdcdefgfghi"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>jkl^_efgjklefg^_jkljkkl-non-portable (kind annotations, rank-2 types) experimentalEdward Kmett <ekmett@gmail.com>mnopqrstmnopqrstmnopqrstmnonopqrqrst"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>uvwxyuvwxyuvwxyuvwxyvwxy"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com> zLeft Kan Extension {|Right Kan Extension }~ z{|}~ |}~z{ z{{|}~}~"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com> `aefg efg`a (There are two ways to define a comonad: I. Provide definitions for , ,, and  satisfying these laws:   extract . duplicate == id  fmap extract . duplicate == id 8 duplicate . duplicate == fmap duplicate . duplicate II. Provide definitions for , and  satisfying these laws:   extend extract == id  extract . extend f == f . extend f . extend g == extend (f . extend g) (2 cannot be defaulted, but a comonad which defines  may simply set  equal to .) $A comonad providing definitions for  and , must also satisfy these laws:  ! extend f == fmap f . duplicate  duplicate == extend id % fmap f == extend (f . duplicate) $(The first two are the defaults for  and , #and the third is the definition of .) % with the arguments swapped. Dual to  for monads. "Injects a value into the comonad. -Transform a function into a comonadic action >Converts a list of comonadic functions into a single function  returning a list of values +,-. portable experimentalEdward Kmett <ekmett@gmail.com>portable experimentalEdward Kmett <ekmett@gmail.com>portable experimentalEdward Kmett <ekmett@gmail.com>+,-.portable provisionalEdward Kmett <ekmett@gmail.com> 6A type that can be used to generate values on demand. = A supply may be turned into two different supplies by using  the functions  and . 9Get the value of a supply. This function, together with   forms a comonad on . >Generate a new supply. This supply is different from the one  generated with . =Generate a new supply. This supply is different from the one  generated with .  Creates a new supply of values. / The arguments specify how to generate values: - the first argument is an initial value, the D second specifies how to generate a new value from an existing one. <Generate a new supply by systematically applying a function 6 to an existing supply. This function, together with   form a comonad on . #A supply of values that are in the  class.  The initial value is toEnum 0 , new values are generates with . #A supply of values that are in the  class. ? The initial value is 0, new values are generated by adding 1. /Generate an infinite list of supplies by using  and   repeatedly. ,Split a supply into two different supplies. = The resulting supplies are different from the input supply. .Split a supply into three different supplies. -Split a supply into four different supplies. +,-. &non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>MAdjunction-oriented composition, yields monads and comonads from adjunctions An  formed by the ~ f and ~ g. "non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com> portable experimentalEdward Kmett <ekmett@gmail.com>!&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>"&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>#%non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com>IA category with a coassociative bifunctor satisyfing the dual of Mac Lane'%s pentagonal coherence identity law: W bimap coassociate id . coassociate . bimap id coassociate = coassociate . coassociate <A category with an associative bifunctor satisfying Mac Lane'%s pentagonal coherence identity law: M bimap id associate . associate . bimap associate id = associate . associate $portable experimentalEdward Kmett <ekmett@gmail.com>If we have a symmetric (co)Monoidal' category, you get the additional law:  swap . swap = id rA braided (co)(monoidal or associative) category can commute the arguments of its bi-endofunctor. Obeys the laws:  idr . braid = idl  idl . braid = idr  braid . coidr = coidl  braid . coidl = coidr I associate . braid . associate = second braid . associate . first braid O coassociate . braid . coassociate = first braid . coassociate . second braid %%non-portable (class-associated types) experimentalEdward Kmett <ekmett@gmail.com>IA comonoidal category satisfies the dual form of the triangle identities  + bimap idr id = coassociate . bimap id idl + bimap id idl = coassociate . bimap idr id gThis type class is also (ab)used for the inverse operations needed for a strict (co)monoidal category. 3A strict (co)monoidal category is one that is both  and # and satisfies the following laws:  idr . coidr = id  idl . coidl = id  coidl . idl = id  coidr . idr = id A monoidal category.  and * are traditionally denoted lambda and rho  the triangle identity holds: * bimap idr id = bimap id idl . associate ) bimap id idl = bimap idr id . associate /Denotes that we have some reasonable notion of Identity for a particular  in this Category. This " notion is currently used by both  and  45&portable experimentalEdward Kmett <ekmett@gmail.com>45'portable experimentalEdward Kmett <ekmett@gmail.com>45(portable experimentalEdward Kmett <ekmett@gmail.com>)portable experimentalEdward Kmett <ekmett@gmail.com> 6789:;< *portable experimentalEdward Kmett <ekmett@gmail.com>+"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>Yhigher order hylomorphisms for use in building up and tearing down higher order functors ,non-portable (MPTCs) experimentalEdward Kmett <ekmett@gmail.com> +,-.  -portable experimentalEdward Kmett <ekmett@gmail.com>   +,-.          .&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>        /"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>    0portable experimentalEdward Kmett <ekmett@gmail.com>1portable experimentalEdward Kmett <ekmett@gmail.com> !"#$%& !"#$%& !"$%&# !"!"#$%&2portable experimentalEdward Kmett <ekmett@gmail.com>'()'()'()'()()3portable experimentalEdward Kmett <ekmett@gmail.com>*+,-.*+,-.*+,-.*+,+,-.4"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>/01234/01234/01234/012345"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>567895678956789567896"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>:;<=>:;<=><=;:>:;<=>7"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>?'Anamorphisms are a generalized form of unfoldr @QGeneralized anamorphisms allow you to work with a monad given a distributive law A,The distributive law for the identity monad BCDCA higher-order anamorphism for constructing higher order functors. ?@ABCD?@ABCD?@ABCD8"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>EFEFEFEF9"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com> GHIJKLMNO GHIJKLMNO KLJIHGMNO GHIJKLMNO rank-2 types  experimentalEdward Kmett <ekmett@gmail.com>PQRSTU'()*+,PQRSTU'()*+,QPRSTUPQRSTU:&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>VMinimum definition: bizapWith WXYMinimum definition: zapWith Z[\]VWXYZ[\]YZ[\VWX]VWXWXYZ[Z[\];"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>^_`^_`^_`^_`<"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>aaaa=portable experimentalEdward Kmett <ekmett@gmail.com>bcdefgB~ !"#$%&bcdefgcbdefgbcdefg>portable experimentalEdward Kmett <ekmett@gmail.com> hijMinimum definition:  bizipWith  bizip klmMinimum definition:  fzipWith  fzip nopqrs hijklmnopqrs pqrsmnojklhi hiijklklmnonopqrs?"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>tuvtuvtuvtuv@"non-portable (rank-2 polymorphism) experimentalEdward Kmett <ekmett@gmail.com>wxwxwxwxA&non-portable (functional-dependencies) experimentalEdward Kmett <ekmett@gmail.com>yTraditional Hyper functions z2A generic recursive hyperfunction-like combinator {|}9:yz{|}9:zy{|}yz{|}|}BCDBCEBCFGHIGHJGHJKKLMNOPQRSTUVWXYZ[\]^_`aabbcdefghijkl m n o pqqr s t u v w w x y z { |}~~   !!!!""""####$$$$%% % % % % %&&&&''''(((()))))))))**+ +!+"+#+$,%,%,&,',',(,),*,+,,,--.-.-/-0-0-1-2-3.4.5.6.6.7.8.9/:/:/;/</</=/>/?/@/A/B0C0D1E1F1G1H1I1J1K2L2L2M3N3O3P3Q3R4S4T4U4V4W4X5Y5Z5[5\5]6^6_6`6a6b7c7d7e7f7g7h8i8j9k9l9m9n9o9p9q9r9stuvwxy:z:{:|:}:~:::;;;<======>>>>>>>>>>>>???@@AAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBcategory-extras-0.44.4Control.Monad.EitherControl.Comonad.CofreeControl.Functor.RepresentableControl.Functor.FullControl.Functor.IndexedControl.Monad.IndexedControl.Monad.Indexed.ContControl.Comonad.IndexedControl.Functor.PointedControl.Functor.Strong Data.VoidControl.Functor.ContravariantControl.Functor.ExponentialControl.Functor.CompositionControl.Functor.ConstantControl.Functor.ExtrasControl.Functor.HigherOrderControl.Comonad.HigherOrder'Control.Functor.HigherOrder.Composition&Control.Functor.Adjunction.HigherOrderControl.Functor.KanExtensionControl.Monad.HigherOrderControl.ComonadControl.Arrow.CoKleisliControl.Comonad.FixControl.Comonad.PointerControl.Comonad.SupplyControl.Functor.AdjunctionControl.Functor.AlgebraControl.Functor.Fix#Control.Functor.Pointed.CompositionControl.Arrow.BiKleisliControl.BifunctorControl.Bifunctor.PointedControl.Bifunctor.AssociativeControl.Bifunctor.BraidedControl.Bifunctor.MonoidalControl.Bifunctor.FunctorControl.Bifunctor.SwapControl.Bifunctor.CompositionControl.Bifunctor.ConstantControl.Comonad.ParameterizedControl.Morphism.HyloControl.Comonad.ContextControl.Comonad.ReaderControl.Functor.BifunctorControl.Monad.Indexed.State!Control.Applicative.ParameterizedControl.Monad.ParameterizedControl.Bifunctor.BiffControl.Bifunctor.FixControl.Morphism.CataControl.Morphism.ZygoControl.Morphism.ParaControl.Morphism.AnaControl.Morphism.MetaControl.Morphism.ApoControl.Functor.ZapControl.Morphism.HistoControl.Morphism.DynaControl.Monad.FreeControl.Functor.ZipControl.Morphism.FutuControl.Morphism.ChronoControl.Monad.Hyperbase Data.EitherEitherLeftRight mtl-1.1.1.0Control.Monad.Identity runIdentityIdentityEitherF RepresentablerepunrepFaithfulFullpremapunmap IxCopointediextract IxPointedireturn IxApplicativeiap IxFunctorimapIxMonadibindijoin>>>==<<< iapIxMonadIxContIxContT runIxContT IxMonadContresetshift runIxContT_ runIxCont runIxCont_ IxComonadiextend iduplicate CopointedextractPointedpointEitherT runEitherTstrength costrengthVoidvoidContraF runContraFContravariantFunctor contramap ExpFunctorxmap:.:CompFrunCompF Composition decomposecompose associateCompcoassociateCompVoidF ConstantF FunctorSplitfsplit FunctorPlusfplus FunctorZerofzero Distributesdist PreUnfold preUnfoldPreFoldpreFold PostUnfold postUnfoldPostFoldpostFoldNaturalDistLowerHliftH HCopointedhextractHPointedhreturnFixHInHoutHHFunctorffmaphfmapCoAlgHAlgHHComonadhextend hduplicateCompHrunCompH HCompositionhcompose hdecomposehassociateComphcoassociateComp HAdjunctionhunithcounit hleftAdjunct hrightAdjunctLanRanrunRantoRanfromRantoLanfromLanHMonadhbindhjoin>>**==**<<Comonad duplicateextendliftW=>>.>>liftCtxmapW parallelWunfoldW sequenceW CoKleisli runCoKleisli ComonadFixcofixPointerindexarray distPointerSupply supplyValue supplyLeft supplyRight newSupply modifySupply newEnumSupply newNumSupplysplitsplit2split3split4ACompF Adjunctionunitcounit leftAdjunct rightAdjunctCoAlgMAlgWCoAlgAlgliftAlg liftCoAlgFixInFoutFoutMinW DistCompFPreCompF PostCompF PointedCompF BiKleisli runBiKleisli Bifunctorbimapfirstsecond PCopointedpextractPPointedpreturn Coassociative coassociate Associative associate SymmetricBraidedbraidswap ComonoidalcoidlcoidrMonoidalidlidr HasIdentityFunctorB runFunctorB liftFunctorBSwapBrunSwapB liftSwapBCompBrunCompB liftCompBSndBrunSndBFstBrunFstBConstB runConstBPComonadpextendhylog_hylobihylog_bihylohhyloContextT runContextTContextComonadContextgetCmodifyCputC experiment runContextReaderCT runReaderCTReaderC ComonadReaderaskC runReaderC:+::*: BifunctorF runBifunctorF runProductF runCoproductFIxStateT runIxStateTIxState runIxState IxMonadStateigetiputimodifyigets PApplicativepapPMonadpbindpjoin papPMonad>>*==*<<>>*BiffBrunBiffBFixBInBoutBpaugment pcoaugmentcatag_catadistCatabicatag_bicatahcataZygozygog_zygodistZygo distZygoTParaTParaparag_para distParaTanag_anadistAnabianag_bianahanametag_metaGApoTGApoApoTApoapog_apodistGApo distGApoTdistApoTCofreeCofreeB outCofree runCofree anaCofreecofreeBiZap bizapWithbizapZapzapWithzap>$<>>$<<histog_histo distHistodynaFreeFreeBinFreerunFreecataFreefreeCozipcozipBizipbizip bizipWithZipfzipfzipWithunfzipunbizipcounzip counbizipfutug_futudistFutuchronog_chronoHypHyperHyperB runHyperBGHC.BaseFunctorfmap>>=NodeGHC.EnumEnumsuccGHC.NumNumfail>>returnControl.Monad.FixmfixMonadMonadFix Control.Monad MonadPlus Data.FunctionfixapliftM5liftM4liftM3liftM2liftMunlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMjoinforever<=<>=>msumforM_forMfilterMguardmapM_mapM sequence_sequence=<<mplusmzero