git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add some `Functor` functions.

Export operators.

commit108e04f7462f6e360c5f765df96e216ef8f79c71 authorjoneshf <jones3.hardy@gmail.com> dateSun 9 Nov 2014, 22:51 (12 years ago) parent9bd4e3e
1 file changed+13−1
prelude/prelude.purs+13−1
prelude/prelude.purs+13−1
@@ -7,7 +7,7 @@ module Prelude
77 , ($), (#)
88 , (:), cons
99 , Show, show
10− , Functor, (<$>), void
10+ , Functor, (<$>), (<$), ($>), (<#>), void
1111 , Apply, (<*>)
1212 , Applicative, pure, liftA1
1313 , Bind, (>>=)
@@ -111,10 +111,22 @@ module Prelude
111111 show = showArrayImpl show
112112
113113 infixl 4 <$>
114+ infixl 4 <$
115+ infixl 4 $>
116+ infixl 1 <#>
114117
115118 class Functor f where
116119 (<$>) :: forall a b. (a -> b) -> f a -> f b
117120
121+ (<#>) :: forall f a b. (Functor f) => f a -> (a -> b) -> f b
122+ (<#>) fa f = f <$> fa
123+
124+ (<$) :: forall f a b. (Functor f) => b -> f a -> f b
125+ (<$) b fa = const b <$> fa
126+
127+ ($>) :: forall f a b. (Functor f) => f a -> b -> f b
128+ ($>) fa b = const b <$> fa
129+
118130 void :: forall f a. (Functor f) => f a -> f Unit
119131 void fa = const unit <$> fa
120132