10 | ||| A type synonym for `obj -> obj -> Type` to simplify definitions.
17 | ||| A type synonym for (non-dependent) functions.
23 | ------------------------------------------------------------
24 | -- Interface
25 | ------------------------------------------------------------
27 | ||| A *category* is a generalized function type with a notion of
28 | ||| composition and of identity. The elements of this type are
29 | ||| typically called *morphisms*.
30 | |||
31 | ||| This is the interface-style definition of a category. For the
32 | ||| record-style definition, see `Control.Category.Records.CategoryR`.
33 | |||
34 | ||| Laws:
35 | ||| * `id . f = f`
36 | ||| * `f . id = f`
37 | ||| * `(f . g) . h = f . (g . h)`
41 | ||| The identity morphism of an object `a`.
43 | ||| Binary right-to-left composition of morphisms.
47 | ------------------------------------------------------------
48 | -- Functions
49 | ------------------------------------------------------------
54 | ||| A synonym for right-to-left category composition that may be easier
55 | ||| to read. The arrow shows the direction the morphisms are composed.
60 | ||| A synonym for left-to-right category composition that may be easier
61 | ||| to read. The arrow shows the direction the morphisms are composed.
66 | ||| Compose a list of morphisms left-to-right.
74 | ------------------------------------------------------------
75 | -- Existing Instances
76 | ------------------------------------------------------------
78 | -- These instances should not be used unless necessary, as they have
79 | -- poor runtime quantity behavior. Prefer `Typ` over base's `Morphism`
80 | -- and `Kleisli` over base's `Kleislimorphism`.
82 | ||| The `Morphism` type from `Data.Morphisms` forms a category.
89 | ||| Non-dependent functions form a category with the ordinary
90 | ||| composition and identity functions.
96 | ||| Kleislimorphisms (monadic functions) form a category.