@@ -61,6 +61,14 @@ module Prelude
61 infixr 9 >>>
61 infixr 9 >>>
62 infixr 9 <<<
62 infixr 9 <<<
64+ -- | Semigroupoids are Categories, less `id`, which is to say they consist of objects and
65+ -- | morphisms between them which can be composed.
67+ -- | Semigroupoids should obey the following rule:
70+ -- | forall p q r. p <<< (q <<< r) = (p <<< q) <<< r
64 class Semigroupoid a where
72 class Semigroupoid a where
65 (<<<) :: forall b c d. a c d -> a b c -> a b d
73 (<<<) :: forall b c d. a c d -> a b c -> a b d
@@ -70,6 +78,20 @@ module Prelude
70 (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
78 (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
71 (>>>) f g = g <<< f
79 (>>>) f g = g <<< f
81+ -- | Categories consist of objects and composable morphisms between them, and as such are
82+ -- | semigroupoids, but unlike semigroupoids must have an identity element.
84+ -- | Categories should obey the following rules.
86+ -- | Association (as semigroupoids)
87+ -- | forall p q r. p <<< (q <<< r) = (p <<< q) <<< r
90+ -- | forall p. id <<< p = p
93+ -- | forall p. p <<< id = p
73 class (Semigroupoid a) <= Category a where
95 class (Semigroupoid a) <= Category a where
74 id :: forall t. a t t
96 id :: forall t. a t t