monoids-in-the-category-of-.../src/Relation/Transitive.hs

13 lines
267 B
Haskell

module Relation.Transitive (Transitive, (.)) where
import Relation.Base
import Data.Kind (Constraint)
type Transitive :: Relation k -> Constraint
class Transitive r where
(.) :: r y z -> r x y -> r x z
instance Transitive (->) where
g . f = \x -> g (f x)