Y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX 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. YOp (~>)& is opposite category of the category (~>). ZLThe category with Haskell types as objects and Haskell functions as arrows.  non-portable experimentalsjoerd@w3future.com [!The product category of category c1 and c2.     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 dual of a functor ' is a wrapper to turn instances of the  " class into categorical functors. D is a bifunctor that projects out the first component of a product.   E is a bifunctor that projects out the second component of a product. !" f1 :***: f2 is the product of the functors f1 and f2. #$#$' is the diagonal functor for products. %&%&) tuples with a fixed object on the left. '('(* tuples with a fixed object on the right. )*qThe Hom functor, Hom(,), a bifunctor contravariant in its first argument and covariant in its second argument. +,-The covariant functor Hom(X,) .#The contravariant functor Hom(,X) \CatC is the category with categories as objects and funtors as arrows. %  !"#$%&'()*+,-.%  "!$#&%('*)+-,.%   !"!#$#%&%'(')*)+,-. non-portable experimentalsjoerd@w3future.com /f :~> g: is a natural transformation from functor f to functor g. 015Natural transformations are built up of components,  one for each object z in the domain category of f and g. 2A component for an object z is an arrow from F z to G z. 345"A newtype wrapper for components, E which can be useful for helper functions dealing with components. 6The category of endofunctors. 78*Composition of endofunctors is a functor. 9:Precompose f d is the functor such that Precompose f d :% g = g :.: f,  for functors g that compose with f and with codomain d. ;<Postcompose f c is the functor such that Postcompose f c :% g = f :.: g,  for functors g that compose with f and with domain c. =>Wrap f h is the functor such that Wrap f h :% g = f :.: g :.: h,  for functors g that compose with f and h. ?'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). @3Horizontal composition of natural transformations. A2The identity natural transformation of a functor. BCDEFGHIJKLM]Functor category D^C. * Objects of D^C are functors from C to D. , Arrows of D^C are natural transformations. /0123456789:;<=>?@ABCDEFGHIJKLM/2543?@ABC106DEFGHIJKLM87:9<;>=/01023454367879:9;<;=>=?@ABCDEFGHIJKLM non-portable experimentalsjoerd@w3future.com NOPQRSTUVWXYAAn initial universal property, a universal morphism from x to u. ZAA terminal universal property, a universal morphism from u to x. NOPQRSTUVWXYZ PQRSTUVWXOYNZ NOPQRSTUQRSTUVWXYZ non-portable experimentalsjoerd@w3future.com[\]^_`ab^_`acdefghijbCThe category with categories as objects and adjunctions as arrows. [\]^_`abcdefghij`_^]\[cdebahifgj[\]^_`_^]\[abacdefghij non-portable experimentalsjoerd@w3future.comklmnopqrstuvwxyz{c#The coproduct category of category c1 and c2. klmnopqrstuvwxyz{klomnqpsrutwvyx{zklmnomnpqprsrtutvwvxyxz{z non-portable experimentalsjoerd@w3future.com|}~;The arrows in Discrete n, a finite set of identity arrows. Void is the empty category. Unit+ is the discrete category with one object. Pair, is the discrete category with two objects. The functor from  Discrete n to (~>), a diagram of n objects in (~>). dDiscrete (S n)4 is the discrete category with one object more than  Discrete n. e Discrete Z+ is the discrete category with no objects. |}~~|}|}~~  non-portable experimentalsjoerd@w3future.com<7The diagonal functor from (index-) category J to (~>). :The diagonal functor with the same domain and codomain as f. TA cone from N to F is a natural transformation from the constant functor to N to F. WA co-cone from F to N is a natural transformation from F to the constant functor to N. Limits in a category (~>) by means of a diagram of type j, which is a functor from j to (~>). 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 Colimits in a category (~>) by means of a diagram of type j, which is a functor from j to (~>). 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. <The limit functor is right adjoint to the diagonal functor. =The colimit functor is left adjoint to the diagonal functor. f[The initial object of the product of 2 categories is the product of their initial objects. gaThe constant functor to the initial object is itself the initial object in its functor category. h,The empty category is the initial object in Cat. i,Any empty data type is an initial object in Hask. j]The terminal object of the product of 2 categories is the product of their terminal objects. kcThe constant functor to the terminal object is itself the terminal object in its functor category. lUnit is the terminal category. m() is the terminal object in Hask. 444  non-portable experimentalsjoerd@w3future.com  non-portable experimentalsjoerd@w3future.com  non-portable experimentalsjoerd@w3future.comThe Yoneda embedding functor.   non-portable experimentalsjoerd@w3future.com)The arrows are the values of the monoid.   n>The category of all monoids, with monoid morphisms as arrows. o(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. p5True is the terminal object in the Boolean category. q5False is the initial object in the Boolean category. rBooleanR 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>. :;<=>?@ABC(Catamorphisms for endofunctors in Hask. D'Anamorphisms for endofunctors in Hask. EF)*+,-./0123456789:;<=>?@ABCDEF*),+AB-./01234765CD98<:;E>=@?F)*)+,+-./0123456765898:;<:;=>=?@?ABCDEF non-portable experimentalsjoerd@w3future.com GHIJKLM3The natural numbers are the initial object for the J category. NOP@Primitive recursion is the factorizer from the natural numbers. GHIJKLMNOP HGJINOMKLP GHGIJIKLMKLNOP non-portable experimentalsjoerd@w3future.comQRSTUVWXQRSTUVWXWXUVTSRQQRSTUVVWXXs !"#$$%%&&'(())**++,,--..//0012345667899:;;<<==>>?@ABCDEFGHIJKLMNOPPQRSTUVWXYZ[\]^^__`abcdefghihijkkllmmnnooppqrqrstuvwwxyz{| } } ~                              u   [   Z                                  qrqr  qr      qr  !"#$$%%&'() * + , - . / 0 1 2 34567data-category-0.4 Data.CategoryData.Category.ProductData.Category.Functor#Data.Category.NaturalTransformation"Data.Category.RepresentableFunctorData.Category.AdjunctionData.Category.CoproductData.Category.DiscreteData.Category.LimitData.Category.MonoidalData.Category.CartesianClosedData.Category.YonedaData.Category.MonoidData.Category.BooleanData.Category.OmegaData.Category.KleisliData.Category.DialgData.Category.PeanoData.Category.CommaOpunOpCategorysrctgt.Obj:**:DomCod%Functor:%CatACatCatWId:.:ConstConstFOppositeEndoHaskProj1Proj2:***:DiagProdTuple1Tuple2Hom:*-::-*:homX_hom_X:~>Nat ComponentunComComEndoFunctorCompose Precompose PostcomposeWrap!onatIdsrcFtgtF compAssoc compAssocInv idPrecomp idPrecompInv idPostcomp idPostcompInv constPrecompconstPrecompInv constPostcompconstPostcompInvTerminalUniversalInitialUniversal RepresentablerepresentedFunctorrepresentingObject representuniversalElement unrepresentcovariantHomReprcontravariantHomReprinitialUniversalterminalUniversalcounitunit rightAdjoint leftAdjoint AdjunctionAdjArrow mkAdjunction leftAdjunct rightAdjunctadjunctionInitialPropadjunctionTerminalPropinitialPropAdjunctionterminalPropAdjunctioncontAdjI1I2:++:Inj1Inj2:+++: CodiagCoprodCotuple1Cotuple2ZSDiscreteVoidUnitPairSuccNil:::DiscreteDiagrammagicZvoidNatDiagDiagFConeCoconeLimitFamLimitlimitFactorizerlimit HasLimits LimitFunctor ColimitFamColimitcolimitFactorizercolimit HasColimitsColimitFunctor terminateterminalObjectTerminalObjectHasTerminalObject initialize initialObject InitialObjectHasInitialObjectZero BinaryProduct***&&&proj2proj1HasBinaryProductsProductFunctor:*:BinaryCoproduct+++|||inj2inj1HasBinaryCoproductsCoproductFunctor:+: coneVertex coconeVertexlimitAdj colimitAdj unitObjectHasUnit associatorInv associatorrightUnitorInv rightUnitor leftUnitorInv leftUnitor TensorProductmultiply MonoidObject comultiplyComonoidObject MonoidValueMonoidAsCategoryMonadComonad preludeMonoidmkMonad preludeMonad monadFunctor mkComonadadjunctionMonadadjunctionComonad Exponential^^^tupleapplyCartesianClosed ExpFunctorCatApplyCatTuple PresheavesPShExponential ProductWithExponentialWithStateContextcurryAdjcurryuncurrystateMonadReturnstateMonadJoincontextComonadExtractcontextComonadDuplicateYonedayonedaEmbedding fromYonedatoYonedaMonoidAMonoidMorphismMon ForgetMonoid FreeMonoidunMonoidMorphism freeMonoidAdjfoldMaplistMonadReturn listMonadJoinlistComonadExtractlistComonadDuplicateFlsTruF2TBoolean NatAsFunctortrueProductMonoidfalseCoproductComonoidtrueProductComonoidfalseCoproductMonoidtrueCoproductMonoidfalseProductComonoidZ2SOmega zeroMonoid zeroComonoidKleisli KleisliAdjF KleisliAdjG kleisliId kleisliAdj DialgebraDialgADialgAlgAlgebraCoalg CoalgebraInitialFAlgebraTerminalFAlgebraCataAnaoutFInFFixFNatFNatNumEMAdjFEMAdjGdialgId dialgebracataHaskanaHaskprimReceilenbergMooreAdjPeanoOPeanoAPeanopeanoIdpeanoO ObjectsOver ObjectsUnder ObjectsFOver ObjectsFUnder:/\:CommaACommaO $fCategoryOp$fCategory(->)$fCategory:**: $fCategoryCat $fCategoryNatCont1Cont2$fCategoryAdjArrow$fCategory:++:$fCategoryDiscrete$fCategoryDiscrete0$fHasInitialObject:**:$fHasInitialObjectNat$fHasInitialObjectCat$fHasInitialObject(->)$fHasTerminalObject:**:$fHasTerminalObjectNat$fHasTerminalObjectCat$fHasTerminalObject(->) $fCategoryMon$fCategoryMonoidA$fHasTerminalObjectBoolean$fHasInitialObjectBoolean$fCategoryBoolean