X      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW 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. XOp (~>)& is opposite category of the category (~>). YLThe category with Haskell types as objects and Haskell functions as arrows.  non-portable experimentalsjoerd@w3future.com Z!The product category of category c1 and c2.     non-portable experimentalsjoerd@w3future.com8 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 constant functor with the same domain and codomain as f.  !"#$%&'()*+,-./01 The covariant functor Hom(X,--) 2$The contravariant functor Hom(--,X) [sThe Hom functor, Hom(--,--), a bifunctor contravariant in its first argument and covariant in its second argument. \+,* tuples with a fixed object on the right. ])*) tuples with a fixed object on the left. ^'(' is the diagonal functor for products. _ f1 :***: f2 is the product of the functors f1 and f2. `#$E is a bifunctor that projects out the second component of a product. a!"D is a bifunctor that projects out the first component of a product. b ' is a wrapper to turn instances of the  " class into categorical functors. cThe  x = Op (Op x) functor. dThe  Op (Op x) = x functor. eThe dual of a functor fThe constant functor. g!The composition of two functors. hThe identity functor on (~>) iCatC is the category with categories as objects and funtors as arrows. )  !"#$%&'()*+,-./012)  "!$#&%('*),+.-/102)   !"!#$#%&%'(')*)+,+-.-/012 non-portable experimentalsjoerd@w3future.com$3f :~> g: is a natural transformation from functor f to functor g. 455Natural transformations are built up of components,  one for each object z in the domain category of f and g. 6A component for an object z is an arrow from F z to G z. 789"A newtype wrapper for components, E which can be useful for helper functions dealing with components. :The category of endofunctors. ;<=>?@ABC'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). D3Horizontal composition of natural transformations. E2The identity natural transformation of a functor. FGHIJKLMNOPQjWrap f h is the functor such that Wrap f h :% g = f :.: g :.: h,  for functors g that compose with f and h. kPostcompose f c is the functor such that Postcompose f c :% g = f :.: g,  for functors g that compose with f and with domain c. lPrecompose f d is the functor such that Precompose f d :% g = g :.: f,  for functors g that compose with f and with codomain d. m*Composition of endofunctors is a functor. nFunctor category D^C. * Objects of D^C are functors from C to D. , Arrows of D^C are natural transformations. 3456789:;<=>?@ABCDEFGHIJKLMNOPQ36987CDEFG54:HIJKLMNOPQ<;>=@?BA3454678987:;<;=>=?@?ABACDEFGHIJKLMNOPQ non-portable experimentalsjoerd@w3future.com RSTUVWXYZ[\]AAn initial universal property, a universal morphism from x to u. ^AA terminal universal property, a universal morphism from u to x. RSTUVWXYZ[\]^ TUVWXYZ[\S]R^ RSTUVWXYUVWXYZ[\]^ non-portable experimentalsjoerd@w3future.com_`abcdefghijklmnoCThe category with categories as objects and adjunctions as arrows. _`abcdefghijklmnabcdefghi_`lmjkn_``abcdefbcdefghijklmn non-portable experimentalsjoerd@w3future.comopqrstuvwxyz{|}~p~c projects out to the right category, replacing a value from the left category with a fixed object. q|}c projects out to the left category, replacing a value from the right category with a fixed object. rz{+ is the codiagonal functor for coproducts. s f1 :+++: f2" is the coproduct of the functors f1 and f2. tvw5 is a functor which injects into the right category. utu4 is a functor which injects into the left category. v#The coproduct category of category c1 and c2. opqrstuvwxyz{|}~opsqrutwvyx{z}|~opqrsqrtutvwvxyxz{z|}|~~ non-portable experimentalsjoerd@w3future.com;The arrows in Discrete n, a finite set of identity arrows.  is the empty category. + is the discrete category with one object. , is the discrete category with two objects. The functor from  Discrete n to (~>), a diagram of n objects in (~>). Natural transformations in  are trivial. w A diagram with one more object. xThe empty diagram. y maps each object in  Discrete n to its successor in Discrete (S n). zDiscrete (S n)4 is the discrete category with one object more than  Discrete n. { Discrete Z+ is the discrete category with no objects.   non-portable experimentalsjoerd@w3future.comO: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 (~>). D shows that the limiting cone is universal  i.e. any other cone of f factors through it  @ by returning the morphism between the vertices of the cones. ) returns the limiting cone for a functor f. An instance of HasLimits j (~>) says that (~>) has all limits of type j. Colimits in a category (~>) by means of a diagram of type j, which is a functor from j to (~>). J shows that the limiting co-cone is universal  i.e. any other co-cone of f factors through it  @ by returning the morphism between the vertices of the cones. , returns the limiting co-cone for a functor f. An instance of HasColimits j (~>) says that (~>) has all colimits of type j.  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. |The functor coproduct '(:+:)'0 is the binary coproduct in functor categories. }qThe coproduct of two functors, passing the same object to both functors and taking the coproduct of the results. ~!Binary coproduct as a bifunctor. _The binary coproduct of the product of 2 categories is the product of their binary coproducts. The coproduct of categories '(:++:)' is the binary coproduct in .  is the coproduct in Hask. The coproduct of n, objects is the colimit of the functor from  Discrete n to (~>). The functor product '(:*:)'. is the binary product in functor categories. mThe product of two functors, passing the same object to both functors and taking the product of the results. Binary product as a bifunctor. [The binary product of the product of 2 categories is the product of their binary products. The product of categories '(:**:)' is the binary product in . #The tuple is the binary product in Hask. The product of n* objects is the limit of the functor from  Discrete n to (~>). [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. ,Any empty data type is an initial object in Hask. 5An initial object is the colimit of the functor from 0 to (~>). ]The terminal object of the product of 2 categories is the product of their terminal objects. cThe constant functor to the terminal object is itself the terminal object in its functor category. Unit is the terminal category. () is the terminal object in Hask. 3A terminal object is the limit of the functor from 0 to (~>). If every diagram of type j has a colimit in (~>)! there exists a colimit functor. ) It can be seen as a generalisation of (+++). If every diagram of type j has a limit in (~>) there exists a limit functor. ) It can be seen as a generalisation of (***). 7The diagonal functor from (index-) category J to (~>). 444  non-portable experimentalsjoerd@w3future.com DA monoidal category is a category with some kind of tensor product. 8 A tensor product is a bifunctor, with a unit object. MonoidObject f a defines a monoid a, in a monoidal category with tensor product f. ComonoidObject f a defines a comonoid a. in a comonoidal category with tensor product f. 5A monad is a monoid in the category of endofunctors. 9A comonad is a comonoid in the category of endofunctors. 1Monoids as defined in the prelude are monoids in Hask- with the product functor as tensor product. 4Every adjunction gives rise to an associated monad. 6Every adjunction gives rise to an associated comonad. (A monoid as a category with one object. dFunctor composition makes the category of endofunctors monoidal, with the identity functor as unit. [If a category has all coproducts, then the coproduct functor makes it a monoidal category, $ with the initial object as unit. WIf a category has all products, then the product functor makes it a monoidal category, % with the terminal object as unit.   non-portable experimentalsjoerd@w3future.comXA category is cartesian closed if it has all products and exponentials for all objects. DFrom every adjunction we get a monad, in this case the State monad. AThe product functor is left adjoint the the exponential functor. tFrom the adjunction between the product functor and the exponential functor we get the curry and uncurry functions, 1 generalized to any cartesian closed category. Exponentials in Cat are the functor categories.  converts an object a to the functor +, a.  converts an object a to the functor )* a.  is a bifunctor, Apply :% (f, a) applies f to a, i.e. f :% a. Exponentials in Hask are functions.  The exponential as a bifunctor.   non-portable experimentalsjoerd@w3future.comThe Yoneda embedding functor, C -> Set^(C^op).  and 4 are together the isomophism from the Yoneda lemma.  converts a functor f: into a natural transformation from the hom functor to f.   non-portable experimentalsjoerd@w3future.com)The category of presheaves on a category C is cartesian closed for any C.  non-portable experimentalsjoerd@w3future.com)The arrows are the values of the monoid. BThe free monoid functor is left adjoint to the forgetful functor.    The  functor is the list functor. The ' functor forgets the monoid structure. >The category of all monoids, with monoid morphisms as arrows. 2A (prelude) 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. 9Implication makes the Boolean category cartesian closed. =Disjunction is the binary coproduct in the Boolean category. ;Conjunction is the binary product in the Boolean category. 5True is the terminal object in the Boolean category. 5False is the initial object in the Boolean category. BooleanR is the category with true and false as objects, and an arrow from false to true.        non-portable experimentalsjoerd@w3future.com The arrows of omega, there's an arrow from a to b iff a <= b.  )Zero is a monoid object wrt the maximum. !0Zero is also a comonoid object wrt the maximum. 'The coproduct in omega is the maximum. %The product in omega is the minimum. ( (zero) is the initial object of omega. 7The objects of omega are the natural numbers, and there's an arrow from a to b iff a <= b.  ! ! ! non-portable experimentalsjoerd@w3future.com "#$%&'() The category of Kleisli arrows. "#$%&'()#"(%$'&)"#"$%$&'&() non-portable experimentalsjoerd@w3future.com"*+,Objects of Dialg(F,G) are (F,G)-dialgebras. ,-.Arrows of Dialg(F,G) are (F,G)-homomorphisms. ./012KThe initial F-algebra is the initial object in the category of F-algebras. 3QThe terminal F-coalgebra is the terminal object in the category of F-coalgebras. 4NA catamorphism of an F-algebra is the arrow to it from the initial F-algebra. 5RA anamorphism of an F-coalgebra is the arrow from it to the terminal F-coalgebra. 6789:;<=>?@AB(Catamorphisms for endofunctors in Hask. C'Anamorphisms for endofunctors in Hask. DE ForgetAlg m is the forgetful functor for Alg m. FreeAlg M takes x to the free algebra  (M x, mu_x) of the monad M. ZThe 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>. 8B also provides the terminal F-coalgebra for endofunctors in Hask. 8: provides the initial F-algebra for endofunctors in Hask. "The category of (F,G)-dialgebras. *+,-./0123456789:;<=>?@ABCDE+*-,@A./012345876BC;9:D=<?>E*+*,-,./012345678769:;9:<=<>?>@ABCDE non-portable experimentalsjoerd@w3future.com FGHIJKLMNO@Primitive recursion is the factorizer from the natural numbers. 3The natural numbers are the initial object for the I category. The I category. FGHIJKLMNO GFIHMNLJKO FGFHIHJKLJKMNO non-portable experimentalsjoerd@w3future.com PQRSTUVWThe comma category T \ downarrow S PQRSTUVWVWTUSRQPPQRSTUUVWW !"#$%%&&''())**++,,--..//001122334567899:;<<=>>??@@AABCDEFGHIJKLMNOPQRSSTUVWXYZ[\]]^^_`abcdefghijklklmnnooppqqrrsstutuvwxyzz{|}~                                 x  a   b                        tutu  tu     tu  !"#$%&'()*+,-./0123456789:;<=>?@ABC D E F G H IJKL 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 mnopqrstuvwxyz{|}~data-category-0.4.1 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.PresheafData.Category.MonoidData.Category.BooleanData.Category.OmegaData.Category.KleisliData.Category.DialgData.Category.PeanoData.Category.CommaOpunOpCategorysrctgt.Obj:**:DomCod%Functor:%CatACatCatWId:.:ConstConstFOppositeOpOpOpOpInvEndoHaskProj1Proj2:***:DiagProdTuple1Tuple2Hom:*-::-*:homX_hom_X:~>Nat ComponentunComComEndoFunctorCompose Precompose PostcomposeWrap!onatIdsrcFtgtF compAssoc compAssocInv idPrecomp idPrecompInv idPostcomp idPostcompInv constPrecompconstPrecompInv constPostcompconstPostcompInvTerminalUniversalInitialUniversal RepresentablerepresentedFunctorrepresentingObject representuniversalElement unrepresentcovariantHomReprcontravariantHomReprinitialUniversalterminalUniversalAdjArrow Adjunction leftAdjoint rightAdjointunitcounit mkAdjunction leftAdjunct rightAdjunctadjunctionInitialPropadjunctionTerminalPropinitialPropAdjunctionterminalPropAdjunctioncontAdjI1I2:++:Inj1Inj2:+++: CodiagCoprodCotuple1Cotuple2ZSDiscreteVoidUnitPairSuccNil:::DiscreteDiagrammagicZvoidNatDiagDiagFConeCoconeLimitFamLimitlimitFactorizerlimit HasLimits LimitFunctor ColimitFamColimitcolimitFactorizercolimit HasColimitsColimitFunctor terminateterminalObjectTerminalObjectHasTerminalObject initialize initialObject InitialObjectHasInitialObjectZero BinaryProduct***&&&proj2proj1HasBinaryProductsProductFunctor:*:BinaryCoproduct+++|||inj2inj1HasBinaryCoproductsCoproductFunctor:+: coneVertex coconeVertexlimitAdj colimitAdj associatorInv associatorrightUnitorInv rightUnitor leftUnitorInv leftUnitor unitObject TensorProductmultiply MonoidObject comultiplyComonoidObject MonoidValueMonoidAsCategoryMonadComonad preludeMonoidmkMonad preludeMonad monadFunctor mkComonadadjunctionMonadadjunctionComonad Exponential^^^tupleapplyCartesianClosed ExpFunctorApplyToTuple1ToTuple2StateContextcurryAdjcurryuncurrystateMonadReturnstateMonadJoincontextComonadExtractcontextComonadDuplicateYonedaEmbeddingYonedayonedaEmbedding fromYonedatoYoneda PresheavesPShExponentialpshExponentialMonoidAMonoidMorphismMon ForgetMonoid FreeMonoid freeMonoidAdjfoldMaplistMonadReturn listMonadJoinlistComonadExtractlistComonadDuplicateFlsTruF2TBoolean NatAsFunctortrueProductMonoidfalseCoproductComonoidtrueProductComonoidfalseCoproductMonoidtrueCoproductMonoidfalseProductComonoidZ2SOmega zeroMonoid zeroComonoidKleisli KleisliAdjF KleisliAdjG kleisliId kleisliAdj DialgebraDialgADialgAlgAlgebraCoalg CoalgebraInitialFAlgebraTerminalFAlgebraCataAnaoutFInFFixFNatNumFreeAlg ForgetAlgdialgId dialgebracataHaskanaHaskprimReceilenbergMooreAdjPeanoOPeanoAPeanopeanoIdpeanoO ObjectsOver ObjectsUnder ObjectsFOver ObjectsFUnder:/\:CommaACommaO $fCategoryOp$fCategory(->)$fCategory:**: $fFunctorHom$fFunctorTuple2$fFunctorTuple1$fFunctorDiagProd$fFunctor:***:$fFunctorProj2$fFunctorProj1$fFunctorEndoHask$fFunctorOpOpInv $fFunctorOpOp$fFunctorOpposite$fFunctorConst $fFunctor:.: $fFunctorId $fCategoryCat $fFunctorWrap$fFunctorPostcompose$fFunctorPrecompose$fFunctorFunctorCompose $fCategoryNat$fCategoryAdjArrow$fFunctorCotuple2$fFunctorCotuple1$fFunctorCodiagCoprod$fFunctor:+++: $fFunctorInj2 $fFunctorInj1$fCategory:++:$fFunctorDiscreteDiagram$fFunctorDiscreteDiagram0 $fFunctorSucc$fCategoryDiscrete$fCategoryDiscrete0$fHasBinaryCoproductsNat $fFunctor:+:$fFunctorCoproductFunctor$fHasBinaryCoproducts:**:$fHasBinaryCoproductsCat$fHasBinaryCoproducts(->)base Data.EitherEither$fHasColimitsDiscrete~>$fHasBinaryProductsNat $fFunctor:*:$fFunctorProductFunctor$fHasBinaryProducts:**:$fHasBinaryProductsCat$fHasBinaryProducts(->)$fHasLimitsDiscrete~>$fHasInitialObject:**:$fHasInitialObjectNat$fHasInitialObjectCat$fHasInitialObject(->)$fHasColimitsDiscrete~>0$fHasTerminalObject:**:$fHasTerminalObjectNat$fHasTerminalObjectCat$fHasTerminalObject(->)$fHasLimitsDiscrete~>0$fFunctorColimitFunctor$fFunctorLimitFunctor $fFunctorDiag$fCategoryMonoidAsCategory$fTensorProductFunctorCompose$fTensorProductCoproductFunctor$fTensorProductProductFunctor$fCartesianClosedCat$fFunctorToTuple2$fFunctorToTuple1$fFunctorApply$fCartesianClosed(->)$fFunctorExpFunctor$fFunctorYoneda$fCartesianClosedNat$fFunctorFreeMonoid$fFunctorForgetMonoid $fCategoryMon$fCategoryMonoidA$fFunctorNatAsFunctor$fCartesianClosedBoolean$fHasBinaryCoproductsBoolean$fHasBinaryProductsBoolean$fHasTerminalObjectBoolean$fHasInitialObjectBoolean$fCategoryBoolean$fHasBinaryCoproductsOmega$fHasBinaryProductsOmega$fHasInitialObjectOmega$fCategoryOmega$fCategoryKleisli$fFunctorForgetAlg$fFunctorFreeAlg$fHasInitialObjectDialg$fHasTerminalObjectDialg$fHasInitialObjectDialg0$fCategoryDialg$fHasInitialObjectPeano$fCategoryPeano$fCategory:/\: