3 8      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 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 qrstuvwxyz{|}~ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&DORTAn instance of  Category k declares the arrow k as a category.\Whenever objects are required at value level, they are represented by their identity arrows.Op k& is opposite category of the category k. KThe category with Haskell types as objects and Haskell functions as arrows.   8 BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&:DQR !The product category of category c1 and c2.      BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&9:;DOQRT%<The constant functor with the same domain and codomain as f.,dWe need a wrapper here because objects need to be of kind *, and categories are of kind * -> * -> *.-(Functors are arrows in the category Cat./ Functors map objects and arrows.0/The domain, or source category, of the functor.11The codomain, or target category, of the functor.2:% maps objects.3% maps arrows.4( tuples with a fixed object on the left.555 swaps the 2 categories of the product of categories.6) tuples with a fixed object on the right.7The covariant functor Hom(X,--)8#The contravariant functor Hom(--,X)<rThe Hom functor, Hom(--,--), a bifunctor contravariant in its first argument and covariant in its second argument.=& is the diagonal functor for products.> f1 :***: f2 is the product of the functors f1 and f2.?D is a bifunctor that projects out the second component of a product.@C is a bifunctor that projects out the first component of a product.AThe  x = Op (Op x) functor.BThe  Op (Op x) = x functor.CThe dual of a functorDThe constant functor.E The composition of two functors.FThe identity functor on kGCatB is the category with categories as objects and funtors as arrows.;  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG/  !"#$%&'()*+,-./0213456789:;/-.,/0123*+()&'%#$!" 465789: ;+  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG29 39  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&9:;DNOQRTNPostcompose f c is the functor such that Postcompose f c :% g = f :.: g, for functors g that compose with f and with domain c.OPrecompose f e is the functor such that Precompose f e :% g = g :.: f, for functors g that compose with f and with codomain e.R)Composition of endofunctors is a functor.SThe category of endofunctors.VA component for an object z is an arrow from F z to G z.WINatural transformations are built up of components, one for each object z in the domain category of f and g.Yf :~> g9 is a natural transformation from functor f to functor g.Z-'n ! a' returns the component for the object a of a natural transformation nL. This can be generalized to any arrow (instead of just identity arrows).[2Horizontal composition of natural transformations.\1The identity natural transformation of a functor.kH converts an object a to the functor  a.lJ is a bifunctor, Apply :% (f, a) applies f to a, i.e. f :% a.mWrap f h is the functor such that Wrap f h :% g = f :.: g :.: h, for functors g that compose with f and h.n%Composition of functors is a functor.okFunctor category D^C. Objects of D^C are functors from C to D. Arrows of D^C are natural transformations.(HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno#HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij#YVZ[\]^WXSQP_`abcdefghTUROiNjLMJKHI#HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoZ9  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafeDOQRT{@An initial universal property, a universal morphism from x to u.|@A terminal universal property, a universal morphism from u to x. pqrstuvwxyz{| pqrstuvwxyz{| rstuvwxyzq{p|pqrstuvwxyz{| BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&:DOQRTBThe category with categories as objects and adjunctions as arrows.}~}~}~}~ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&! is the category with one object. BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&:DQR A natural transformation Nat c d! is isomorphic to a functor from c :**: 2 to d..The directed coproduct category of categories c1 and c2.b projects out to the right category, replacing a value from the left category with a fixed object.b projects out to the left category, replacing a value from the right category with a fixed object.* is the codiagonal functor for coproducts. f1 :+++: f2" is the coproduct of the functors f1 and f2.4 is a functor which injects into the right category.3 is a functor which injects into the left category.%The coproduct category of categories c1 and c2.    BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&DQR[a!Since there is nothing to map in 2, there's a functor from it to any other category.! is the category with no objects.  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&9:;<=DOQRT9An instance of HasColimits j k says that k has all colimits of type j., returns the limiting co-cone for a functor f.J shows that the limiting co-cone is universal  i.e. any other co-cone of fS factors through it by returning the morphism between the vertices of the cones.Colimits in a category k by means of a diagram of type j, which is a functor from j to k.An instance of  HasLimits j k says that k has all limits of type j.) returns the limiting cone for a functor f.D shows that the limiting cone is universal  i.e. any other cone of fS factors through it by returning the morphism between the vertices of the cones.Limits in a category k by means of a diagram of type j, which is a functor from j to k.VA co-cone from F to N is a natural transformation from F to the constant functor to N.SA cone from N to F is a natural transformation from the constant functor to N to F.:The diagonal functor with the same domain and codomain as f.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.5A specialisation of the limit adjunction to products.9A specialisation of the colimit adjunction to coproducts.XThe colimit of any diagram with a terminal object, has the limit at the terminal object..The colimit of a single object is that object.UThe limit of any diagram with an initial object, has the limit at the initial object.,The limit of a single object is that object.2Binary products are the dual of binary coproducts.2Binary products are the dual of binary coproducts.1Terminal objects are the dual of initial objects.1Terminal objects are the dual of initial objects.The functor coproduct / is the binary coproduct in functor categories.pThe 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.?In the category of one object that object is its own coproduct. The coproduct of categories  is the binary coproduct in -. If kE has binary coproducts, we can take the colimit of 2 joined diagrams. The functor product - is the binary product in functor categories. lThe product of two functors, passing the same object to both functors and taking the product of the results. Binary product as a bifunctor.ZThe binary product of the product of 2 categories is the product of their binary products.=In the category of one object that object is its own product.The product of categories   is the binary product in -.#The tuple is the binary product in Hask.If kA has binary products, we can take the limit of 2 joined diagrams.gThe initial object of the direct coproduct of categories is the initial object of the initial category.=The category of one object has that object as initial object.ZThe initial object of the product of 2 categories is the product of their initial objects.`The 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 k.jThe terminal object of the direct coproduct of categories is the terminal object of the terminal category.\The terminal object of the product of 2 categories is the product of their terminal objects.>The category of one object has that object as terminal object.bThe 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 k."If every diagram of type j has a colimit in kJ there exists a colimit functor. It can be seen as a generalisation of (+++).#If every diagram of type j has a limit in kH there exists a limit functor. It can be seen as a generalisation of (***).$3The diagonal functor from (index-) category J to k.j      !"#$::M      !"#$2233  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&9:;<=DQRT0!The comma category T \downarrow S %&'()*+,-./0 %&'()*+,-./ +,)*-0('&%./ %&'()*+,-./0  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe $%&9;DOQRT 18A comonad is a comonoid in the category of endofunctors.24A monad is a monoid in the category of endofunctors.5ComonoidObject f a defines a comonoid a. in a comonoidal category with tensor product f.9MonoidObject f a defines a monoid a, in a monoidal category with tensor product f.={A monoidal category is a category with some kind of tensor product. A tensor product is a bifunctor, with a unit object.O3Every adjunction gives rise to an associated monad.P?Every adjunction gives rise to an associated monad transformer.Q5Every adjunction gives rise to an associated comonad.RAEvery adjunction gives rise to an associated comonad transformer.S'A monoid as a category with one object.TcFunctor composition makes the category of endofunctors monoidal, with the identity functor as unit.U~If a category has all coproducts, then the coproduct functor makes it a monoidal category, with the initial object as unit.V{If a category has all products, then the product functor makes it a monoidal category, with the terminal object as unit.&123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV"123456789:;<=>?@ABCDEFGHIJKLMNOPQR&=>?@ABCDEVUT9:;<FG5678HI34S2JKL1MNOPQR123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&DOQRTmEOrdinal addition is a bifuntor, it concattenates the maps as it were.nTurn Cube x y arrows into ACube x -> ACube y functions.WXYZ[\]^_`abcdefghijklmnopWXYZ[\]^_`abcdefghijkkjghibcdefpo^_`a[\]YZnWXml WXYZ[\]^_`abcdefghijklmnop BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe$%&9:;DQRT xQA anamorphism of an F-coalgebra is the arrow from it to the terminal F-coalgebra.yMA catamorphism of an F-algebra is the arrow to it from the initial F-algebra.zPThe terminal F-coalgebra is the terminal object in the category of F-coalgebras.{JThe initial F-algebra is the initial object in the category of F-algebras.-Arrows of Dialg(F,G) are (F,G)-homomorphisms.+Objects of Dialg(F,G) are (F,G)-dialgebras. 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.[The 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>.!The category of (F,G)-dialgebras.qrstuvwxyz{|}~qrstuvwxyz{|}~~}|{zyxuvwstqrqrstuvwxyz{|}~ BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&9:;DOQRTThe category of Kleisli arrows.   BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&DOQRT The maps 0 -> 1 and 2 -> 1) form a monoid, which is universal, c.f. .%Replicate a monoid a number of times.FOrdinal addition makes the simplex category a monoidal category, with 0 as unit.EOrdinal addition is a bifuntor, it concattenates the maps as it were.Turn  Simplex x y arrows into Fin x -> Fin y functions. The ordinal 10 is the terminal object of the simplex category. The ordinal 0/ is the initial object of the simplex category.^The (augmented) simplex category is the category of finite ordinals and order preserving maps. BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafeDOQRTThe Yoneda embedding functor, C -> Set^(C^op). and 3 are together the isomophism from the Yoneda lemma. converts a functor f9 into a natural transformation from the hom functor to f. BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&9;DOQRTCFrom every adjunction we get a monad, in this case the State monad.WA category is cartesian closed if it has all products and exponentials for all objects.@The product functor is left adjoint the the exponential functor.From the adjunction between the product functor and the exponential functor we get the curry and uncurry functions, generalized to any cartesian closed category.)The category of presheaves on a category C is cartesian closed for any C.Exponentials in Cat are the functor categories.Exponentials in Hask are functions.The exponential as a bifunctor. BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe %&DQRT8Implication makes the Boolean category cartesian closed.<Disjunction is the binary coproduct in the Boolean category.:Conjunction is the binary product in the Boolean category.4True is the terminal object in the Boolean category.4False is the initial object in the Boolean category.BooleanQ is the category with true and false as objects, and an arrow from false to true.  BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafeDQR Take the X category, add a new disctinct object, and an arrow from that object to every object in , and you get  again.The  functor wraps  around  f (Fix f).Fix f inherits its exponentials from  f (Fix f).Fix f inherits its (co)limits from  f (Fix f).Fix f inherits its (co)limits from  f (Fix f).Fix f inherits its (co)limits from  f (Fix f).Fix f inherits its (co)limits from  f (Fix f). f7 is the fixed point category for a category combinator f.    BSD-style (see the file LICENSE)sjoerd@w3future.com experimental non-portableSafe%&DQR  !"#$%&&'()**++,,--..//00122334456789:;<=>?@ABCDEFGHIJKLMNOPQQRRSSTUVWXYZZ[\\]^_`abcdefghijklmnopqrstuvvwxyz{|}~                                                                      ! " # # $ % & & ' ( )  * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B B C C D E F G H I J K L M N O P Q R M L S T U V WXXYYZLM[\]^_`abcdeefghijklmnnooppqrstuvvBBCCwxyzLNOML{|}STU~SSq\ZLMh    (data-category-0.7-9esayNcHtT8KcVNpHtp0Le Data.CategoryData.Category.ProductData.Category.Functor#Data.Category.NaturalTransformation"Data.Category.RepresentableFunctorData.Category.AdjunctionData.Category.UnitData.Category.CoproductData.Category.VoidData.Category.LimitData.Category.CommaData.Category.MonoidalData.Category.CubeData.Category.DialgData.Category.KleisliData.Category.SimplexData.Category.YonedaData.Category.CartesianClosedData.Category.BooleanData.Category.FixData.Category.NNOOpunOpCategorysrctgt.Obj $fCategoryOp$fCategory(->):**:$fCategory:**:CostarStarHomF:-*::*-:HomTuple2SwapTuple1DiagProd:***:Proj2Proj1OpOpInvOpOpOppositeConstFConst:.:IdCatWCatCatAFunctorDomCod:%%tuple1swaptuple2homX_hom_XhomFstarcostar $fFunctorHom$fFunctorDiagProd$fFunctor:***:$fFunctorProj2$fFunctorProj1$fFunctorOpOpInv $fFunctorOpOp$fFunctorOpposite$fFunctorConst $fFunctor:.: $fFunctorId $fCategoryCatTupleApplyWrap Postcompose Precompose Profunctors PresheavesEndoFunctorComposeEndoFunctorCompose ComponentNat:~>!onatIdsrcFtgtF compAssoc compAssocInv idPrecomp idPrecompInv idPostcomp idPostcompInvconstPrecompInconstPrecompOutconstPostcompInconstPostcompOut precompose postcompose$fFunctorTuple$fFunctorApply $fFunctorWrap$fFunctorFunctorCompose $fCategoryNatTerminalUniversalInitialUniversal RepresentablerepresentedFunctorrepresentingObject representuniversalElement unrepresentcovariantHomReprcontravariantHomReprinitialUniversalterminalUniversalAdjArrow Adjunction leftAdjoint rightAdjoint leftAdjunctN rightAdjunctN mkAdjunctionmkAdjunctionUnits leftAdjunct rightAdjunctadjunctionUnitadjunctionCounitadjunctionInitialPropadjunctionTerminalPropinitialPropAdjunctionterminalPropAdjunctionidAdj composeAdj precomposeAdjpostcomposeAdjcontAdj$fCategoryAdjArrowUnit$fCategoryUnit NatAsFunctor:>>:I1AI12I2ACotuple2Cotuple1 CodiagCoprod:+++:Inj2Inj1:++:I1I2$fFunctorNatAsFunctor$fCategory:>>:$fFunctorCotuple2$fFunctorCotuple1$fFunctorCodiagCoprod$fFunctor:+++: $fFunctorInj2 $fFunctorInj1$fCategory:++:MagicVoidmagicvoidNat$fFunctorMagic$fCategoryVoid:+:CoproductFunctorHasBinaryCoproductsBinaryCoproductinj1inj2|||+++:*:ProductFunctorHasBinaryProducts BinaryProductproj1proj2&&&***ZeroHasInitialObject InitialObject initialObject initializeHasTerminalObjectTerminalObjectterminalObject terminateColimitFunctor HasColimitscolimitcolimitFactorizerColimit ColimitFam LimitFunctor HasLimitslimitlimitFactorizerLimitLimitFamCoconeConeDiagFDiag coneVertex coconeVertexlimitAdjrightAdjointPreservesLimitsrightAdjointPreservesLimitsInv colimitAdjleftAdjointPreservesColimitsleftAdjointPreservesColimitsInvprodAdj coprodAdj$fHasColimits(->)(->)$fHasLimits(->)(->)$fHasColimits:>>:k$fHasColimitsUnitk$fHasLimits:>>:k$fHasLimitsUnitk$fHasBinaryCoproductsOp$fHasBinaryProductsOp$fHasInitialObjectOp$fHasTerminalObjectOp$fHasBinaryCoproductsNat $fFunctor:+:$fFunctorCoproductFunctor$fHasBinaryCoproducts:>>:$fHasBinaryCoproducts:**:$fHasBinaryCoproductsUnit$fHasBinaryCoproductsCat$fHasColimits:++:k$fHasBinaryProductsNat $fFunctor:*:$fFunctorProductFunctor$fHasBinaryProducts:>>:$fHasBinaryProducts:**:$fHasBinaryProductsUnit$fHasBinaryProductsCat$fHasBinaryProducts(->)$fHasLimits:++:k$fHasInitialObject:>>:$fHasInitialObjectUnit$fHasInitialObject:**:$fHasInitialObjectNat$fHasInitialObjectCat$fHasInitialObject(->)$fHasColimitsVoidk$fHasTerminalObject:>>:$fHasTerminalObject:**:$fHasTerminalObjectUnit$fHasTerminalObjectNat$fHasTerminalObjectCat$fHasTerminalObject(->)$fHasLimitsVoidk$fFunctorColimitFunctor$fFunctorLimitFunctor $fFunctorDiag ObjectsOver ObjectsUnder ObjectsFOver ObjectsFUnder:/\:CommaACommaOcommaIdinitialUniversalCommaterminalUniversalComma$fCategory:/\:ComonadMonadMonoidAsCategory MonoidValueComonoidObjectcounit comultiply MonoidObjectunitmultiply TensorProduct unitObject leftUnitor leftUnitorInv rightUnitorrightUnitorInv associator associatorInv trivialMonoidcoproductMonoidtrivialComonoidproductComonoidmkMonad monadFunctoridMonad mkComonad idComonadadjunctionMonadadjunctionMonadTadjunctionComonadadjunctionComonadT$fCategoryMonoidAsCategory$fTensorProductFunctorCompose$fTensorProductCoproductFunctor$fTensorProductProductFunctorAddForgetACubeNilConsSign0SMS0SPCubeZSYXSignMP$fTensorProductAdd $fFunctorAdd$fFunctorForget$fHasTerminalObjectCube$fCategoryCube ForgetAlgFreeAlgNatNumAnaCataTerminalFAlgebraInitialFAlgebra CoalgebraCoalgAlgebraAlgDialgDialgA DialgebradialgId dialgebraprimReceilenbergMooreAdj$fFunctorForgetAlg$fFunctorFreeAlg$fHasInitialObjectDialg$fCategoryDialg KleisliAdjG KleisliAdjFKleisli kleisliId kleisliAdj$fFunctorKleisliAdjG$fFunctorKleisliAdjF$fCategoryKleisli ReplicateFinFzFsSimplexsucuniversalMonoid$fFunctorReplicate$fHasTerminalObjectSimplex$fHasInitialObjectSimplex$fCategorySimplexYonedaYonedaEmbeddingyonedaEmbedding fromYonedatoYoneda$fFunctorYonedaContextStatePShExponential ExpFunctorCartesianClosed Exponentialapplytuple^^^pshExponentialcurryAdjcurryuncurrystateMonadReturnstateMonadJoincontextComonadExtractcontextComonadDuplicate$fCartesianClosedNat$fCartesianClosedCat$fCartesianClosed(->)$fFunctorExpFunctorBooleanFlsF2TTrutrueProductMonoidfalseCoproductComonoidtrueProductComonoidfalseCoproductMonoidtrueCoproductMonoidfalseProductComonoid$fCartesianClosedBoolean$fHasBinaryCoproductsBoolean$fHasBinaryProductsBoolean$fHasTerminalObjectBoolean$fHasInitialObjectBoolean$fCategoryBooleanOmegaFix$fCartesianClosedFix$fHasBinaryCoproductsFix$fHasBinaryProductsFix$fHasTerminalObjectFix$fHasInitialObjectFix $fCategoryFixPrimRecHasNaturalNumberObjectNaturalNumberObjectzerosucc$fFunctorPrimRec$fHasNaturalNumberObjectCat$fHasNaturalNumberObject(->)ExistsForAll