T      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS non-portable experimentalsjoerd@w3future.com An instance of  Category (~>) declares the arrow (~>) as a category. ]Whenever objects are required at value level, they are represented by their identity arrows. TOp (~>)& is opposite category of the category (~>). ULThe category with Haskell types as objects and Haskell functions as arrows.  non-portable experimentalsjoerd@w3future.com"0The domain, or source category, of the functor. 2The codomain, or target category, of the functor. % maps arrows. !Functors map objects and arrows. :% maps objects. )Functors are arrows in the category Cat. eWe need a wrapper here because objects need to be of kind *, and categories are of kind * -> * -> *. The identity functor on (~>) !The composition of two functors. The constant functor.  The covariant functor Hom(X,--) $The contravariant functor Hom(--,X) The dual of a functor ' is a wrapper to turn instances of the  " class into categorical functors.  !"#AAn initial universal property, a universal morphism from x to u. $%&'(AA terminal universal property, a universal morphism from u to x. VCatC is the category with categories as objects and funtors as arrows. !  !"#$%&'(!  #"! ('&%$!    !"#"! $%&'('&%$ non-portable experimentalsjoerd@w3future.com)*+,-./0123456W!The product category of category c1 and c2. )*+,-./0123456*),+.-0/214365)*)+,+-.-/0/121343565 non-portable experimentalsjoerd@w3future.com7f :~> g: is a natural transformation from functor f to functor g. 895Natural transformations are built up of components,  one for each object z in the domain category of f and g. :A component for an object z is an arrow from F z to G z. ;<="A newtype wrapper for components, E which can be useful for helper functions dealing with components. >The category of endofunctors. ?@*Composition of endofunctors is a functor. ABPrecompose f d is the functor such that Precompose f d :% g = g :.: f,  for functors g that compose with f and with codomain d. CDPostcompose f c is the functor such that Postcompose f c :% g = f :.: g,  for functors g that compose with f and with domain c. EFWrap f h is the functor such that Wrap f h :% g = f :.: g :.: h,  for functors g that compose with f and h. GHIJKkA functor F: Op(C) -> Set is representable if it is naturally isomorphic to the contravariant hom-functor. LMThe Yoneda embedding functor. NOP'n ! a'& returns the component for the object a of a natural transformation n. K This can be generalized to any arrow (instead of just identity arrows). Q3Horizontal composition of natural transformations. R2The identity natural transformation of a functor. STXFunctor category D^C. * Objects of D^C are functors from C to D. , Arrows of D^C are natural transformations. 789:;<=>?@ABCDEFGHIJKLMNOPQRST7:=<;PQR98>@?BADCFEGKJIHMLONST7898:;<=<;>?@?ABACDCEFEGHIJKJIHLMLNONPQRST non-portable experimentalsjoerd@w3future.comUVWXYZ[\]^_`abcdeY!The product category of category c1 and c2. UVWXYZ[\]^_`abcdeUVYWX[Z]\_^a`cbedUVWXYWXZ[Z\]\^_^`a`bcbded non-portable experimentalsjoerd@w3future.comfghij;The arrows in Discrete n, a finite set of identity arrows. kVoid is the empty category. lUnit+ is the discrete category with one object. mPair, is the discrete category with two objects. ZnopqrThe functor from  Discrete n to (~>), a diagram of n objects in (~>). [s\Discrete (S n)4 is the discrete category with one object more than  Discrete n. ] Discrete Z+ is the discrete category with no objects. fghijklmnopqrsjhifgklmonrpqsfghijhiklmnonpqrpqs non-portable experimentalsjoerd@w3future.comGtu7The diagonal functor from (index-) category J to (~>). v:The diagonal functor with the same domain and codomain as f. wTA cone from N to F is a natural transformation from the constant functor to N to F. xWA co-cone from F to N is a natural transformation from F to the constant functor to N. yLimits in a category (~>) by means of a diagram of type j, which is a functor from j to (~>). z{ A limit of f6 is a universal morphism from the diagonal functor to f. |Colimits in a category (~>) by means of a diagram of type j, which is a functor from j to (~>). }~ A colimit of f is a universal morphism from f to the diagonal functor. An instance of HasLimits j (~>) says that (~>) has all limits of type j. If every diagram of type j has a limit in (~>) there exists a limit functor. >Applied to a natural transformation it is a generalisation of (***): l  r =     arrowPair l r An instance of HasColimits j (~>) says that (~>) has all colimits of type j. If every diagram of type j has a colimit in (~>)! there exists a colimit functor. >Applied to a natural transformation it is a generalisation of (+++): l  r =     arrowPair l r 3A terminal object is the limit of the functor from 0 to (~>). 5An initial object is the colimit of the functor from 0 to (~>). HThe product of 2 objects is the limit of the functor from Pair to (~>). Binary product as a bifunctor. The product of two functors. LThe coproduct of 2 objects is the colimit of the functor from Pair to (~>). !Binary coproduct as a bifunctor. The coproduct of two functors.  The vertex (or apex) of a cone. #The vertex (or apex) of a co-cone. limitUniversal` is a helper function to create the universal property from the limit and the limit factorizer. A limit of the diagram f is a cone of f. For any other cone of f with vertex n% there exists a unique morphism from n to the limit of f. colimitUniversald is a helper function to create the universal property from the colimit and the colimit factorizer. A colimit of the diagram f is a co-cone of f. For any other co-cone of f with vertex n4 there exists a unique morphism from the colimit of f to n. ^[The initial object of the product of 2 categories is the product of their initial objects. _aThe constant functor to the initial object is itself the initial object in its functor category. `,The empty category is the initial object in Cat. a,Any empty data type is an initial object in Hask. b]The terminal object of the product of 2 categories is the product of their terminal objects. ccThe constant functor to the terminal object is itself the terminal object in its functor category. dUnit is the terminal category. e() is the terminal object in Hask. ?tuvwxyz{|}~?utvwxyz{|}~?tutvwxyz{|}~ non-portable experimentalsjoerd@w3future.com  non-portable experimentalsjoerd@w3future.comfghi<The limit functor is right adjoint to the diagonal functor. =The colimit functor is left adjoint to the diagonal functor. jCThe category with categories as objects and adjunctions as arrows.   non-portable experimentalsjoerd@w3future.com  non-portable experimentalsjoerd@w3future.com)The arrows are the values of the monoid.   k>The category of all monoids, with monoid morphisms as arrows. l(A monoid as a category with one object.        non-portable experimentalsjoerd@w3future.com   A natural transformation Nat c d! is isomorphic to a functor from c :**: 2 to d. m5True is the terminal object in the Boolean category. n5False is the initial object in the Boolean category. oBooleanR is the category with true and false as objects, and an arrow from false to true.             non-portable experimentalsjoerd@w3future.comThe arrows of omega, there's an arrow from a to b iff a <= b.      non-portable experimentalsjoerd@w3future.com!"#$%&'(!"#$%&'("!'$#&%(!"!#$#%&%'( non-portable experimentalsjoerd@w3future.com)*,Objects of Dialg(F,G) are (F,G)-dialgebras. +,.Arrows of Dialg(F,G) are (F,G)-homomorphisms. -./01KThe initial F-algebra is the initial object in the category of F-algebras. 2QThe terminal F-coalgebra is the terminal object in the category of F-coalgebras. 3NA catamorphism of an F-algebra is the arrow to it from the initial F-algebra. 4RA anamorphism of an F-coalgebra is the arrow from it to the terminal F-coalgebra. 5677: provides the initial F-algebra for endofunctors in Hask. 89ZThe category for defining the natural numbers and primitive recursion can be described as   Dialg(F,G), with F(A)=<1,A> and G(A)=<A,A>. :;<=>?(Catamorphisms for endofunctors in Hask. @'Anamorphisms for endofunctors in Hask. A)*+,-./0123456789:;<=>?@A*),+=>-./01234765?@98<:;A)*)+,+-./0123456765898:;<:;=>?@A non-portable experimentalsjoerd@w3future.com BCDEFGH3The natural numbers are the initial object for the E category. IJK@Primitive recursion is the factorizer from the natural numbers. BCDEFGHIJK CBEDIJHFGK BCBDEDFGHFGIJK non-portable experimentalsjoerd@w3future.comLMNOPQRSLMNOPQRSRSPQONMLLMNOPQQRSSp !!""##$%&'())**+,-../012233445566778899:;;<=>>?@@AABBCCDEFGHIIJJKLMNOPQPQRSSTTUUVVWWXXYZYZ[\]^__`abcddefghijklmnoppqrsstuvwxyz{|}~]                                     Y Z Y  Z  YZ      YZ  !"#$%&'( ) ) * * + , - . / 01data-category-0.3.1.1 Data.CategoryData.Category.FunctorData.Category.Product#Data.Category.NaturalTransformationData.Category.CoproductData.Category.DiscreteData.Category.LimitData.Category.MonoidalData.Category.AdjunctionData.Category.CartesianClosedData.Category.MonoidData.Category.BooleanData.Category.OmegaData.Category.KleisliData.Category.DialgData.Category.PeanoData.Category.CommaOpunOpCategorysrctgt.ObjDomCod%Functor:%CatACatCatWId:.:ConstConstFHomX_:*-:Hom_X:-*:OppositeEndoHaskinitialFactorizerinitialMorphismiuObjectInitialUniversalterminalFactorizerterminalMorphismtuObjectTerminalUniversal:**:Proj1Proj2:***:DiagProdTuple1Tuple2:~>Nat ComponentunComComEndoFunctorCompose Precompose PostcomposeWrap Presheaves unrepresent representRepresentingObject RepresentableYonedaEmbeddingYoneda!onatId fromYonedatoYonedaI1I2:++:Inj1Inj2:+++: CodiagCoprodCotuple1Cotuple2ZSDiscreteVoidUnitPairNextNil:::DiscreteDiagramvoidNatDiagDiagFConeCoconeLimitFamLimitLimitUniversal ColimitFamColimitColimitUniversal limitUniv HasLimits LimitFunctor colimitUniv HasColimitsColimitFunctor terminateterminalObjectTerminalObjectHasTerminalObject initialize initialObject InitialObjectHasInitialObjectZero BinaryProduct***&&&proj2proj1HasBinaryProductsProductFunctor:*:BinaryCoproduct+++|||inj2inj1HasBinaryCoproductsCoproductFunctor:+:unForAllForAllExists coneVertex coconeVertexlimitUniversallimitlimitFactorizercolimitUniversalcolimitcolimitFactorizer endoHaskLimitendoHaskColimit unitObjectHasUnit associatorInv associatorrightUnitorInv rightUnitor leftUnitorInv leftUnitor TensorProductmultiplyunit MonoidObject comultiplycounitComonoidObject MonoidValueMonoidAsCategoryMonadComonad preludeMonoidmkMonad preludeMonad monadFunctor mkComonad rightAdjoint leftAdjoint AdjunctionAdjArrow mkAdjunction leftAdjunct rightAdjunctadjunctionInitialPropadjunctionTerminalPropinitialPropAdjunctionterminalPropAdjunctionlimitAdj colimitAdjadjunctionMonadadjunctionComonadcontAdj Exponential^^^tupleapplyCartesianClosed ExpFunctorCatApplyCatTuplePShExponential ProductWithExponentialWithStateContextcurryAdjcurryuncurrystateMonadReturnstateMonadJoincontextComonadExtractcontextComonadDuplicateMonoidAMonoidMorphismMon ForgetMonoid FreeMonoidunMonoidMorphism freeMonoidAdjfoldMaplistMonadReturn listMonadJoinlistComonadExtractlistComonadDuplicateFlsTruF2TBoolean NatAsFunctortrueProductMonoidfalseCoproductComonoidtrueProductComonoidfalseCoproductMonoidtrueCoproductMonoidfalseProductComonoidZ2SOmega zeroMonoid zeroComonoidKleisli KleisliAdjF KleisliAdjG kleisliId kleisliAdj DialgebraDialgADialgAlgAlgebraCoalg CoalgebraInitialFAlgebraTerminalFAlgebraCataAnaoutFInFFixFNatFNatNumdialgId dialgebracataHaskanaHaskprimRecPeanoOPeanoAPeanopeanoIdpeanoO ObjectsOver ObjectsUnder ObjectsFOver ObjectsFUnder:/\:CommaACommaO $fCategoryOp$fCategory(->) $fCategoryCat$fCategory:**: $fCategoryNat$fCategory:++: PredDiscretemagicZ$fCategoryDiscrete$fCategoryDiscrete0$fHasInitialObject:**:$fHasInitialObjectNat$fHasInitialObjectCat$fHasInitialObject(->)$fHasTerminalObject:**:$fHasTerminalObjectNat$fHasTerminalObjectCat$fHasTerminalObject(->)Cont1Cont2$fCategoryAdjArrow $fCategoryMon$fCategoryMonoidA$fHasTerminalObjectBoolean$fHasInitialObjectBoolean$fCategoryBoolean