git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Factor out backwards composition from Category
9a98095Phil Freeman
prelude/prelude.purs+3−2
@@ -12,12 +12,13 @@ module Prelude where
12 class Category a where
12 class Category a where
13 id :: forall t. a t t
13 id :: forall t. a t t
14 (<<<) :: forall b c d. a c d -> a b c -> a b d
14 (<<<) :: forall b c d. a c d -> a b c -> a b d
15+
15− (>>>) :: forall b c d. a b c -> a c d -> a b d
16+ (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
17+ (>>>) f g = g <<< f
16
18
17 instance categoryArr :: Category (->) where
19 instance categoryArr :: Category (->) where
18 id x = x
20 id x = x
19 (<<<) f g x = f (g x)
21 (<<<) f g x = f (g x)
20− (>>>) f g x = g (f x)
21
22
22 infixr 0 $
23 infixr 0 $
23 infixl 0 #
24 infixl 0 #