git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix tests
585d34aPhil Freeman
examples/passing/Do.purs+2−2
@@ -16,8 +16,8 @@ instance applicativeMaybe :: Applicative Maybe where
16 pure = Just
16 pure = Just
17
17
18instance bindMaybe :: Bind Maybe where
18instance bindMaybe :: Bind Maybe where
19− (>>=) Nothing _ = Nothing
19+ bind Nothing _ = Nothing
20− (>>=) (Just a) f = f a
20+ bind (Just a) f = f a
21
21
22instance monadMaybe :: Prelude.Monad Maybe
22instance monadMaybe :: Prelude.Monad Maybe
23
23
examples/passing/MonadState.purs+1−1
@@ -22,7 +22,7 @@ instance applicativeState :: Applicative (State s) where
22 pure a = State $ \s -> Tuple s a
22 pure a = State $ \s -> Tuple s a
23
23
24instance bindState :: Bind (State s) where
24instance bindState :: Bind (State s) where
25− (>>=) f g = State $ \s -> case runState s f of
25+ bind f g = State $ \s -> case runState s f of
26 Tuple s1 a -> runState s1 (g a)
26 Tuple s1 a -> runState s1 (g a)
27
27
28instance monadState :: Monad (State s)
28instance monadState :: Monad (State s)
examples/passing/NewtypeEff.purs+1−1
@@ -19,7 +19,7 @@ instance applicativeT :: Applicative T where
19 pure t = T (pure t)
19 pure t = T (pure t)
20
20
21instance bindT :: Bind T where
21instance bindT :: Bind T where
22− (>>=) (T t) f = T (t >>= \x -> runT (f x))
22+ bind (T t) f = T (t >>= \x -> runT (f x))
23
23
24instance monadT :: Monad T
24instance monadT :: Monad T
25
25
examples/passing/RebindableSyntax.purs+2−2
@@ -9,7 +9,7 @@ example1 = do
9 " for"
9 " for"
10 " Semigroup"
10 " Semigroup"
11 where
11 where
12− (>>=) x f = x <> f unit
12+ bind x f = x <> f unit
13
13
14(*>) :: forall f a b. (Apply f) => f a -> f b -> f b
14(*>) :: forall f a b. (Apply f) => f a -> f b -> f b
15(*>) fa fb = const id <$> fa <*> fb
15(*>) fa fb = const id <$> fa <*> fb
@@ -32,7 +32,7 @@ example2 = do
32 Const " for"
32 Const " for"
33 Const " Apply"
33 Const " Apply"
34 where
34 where
35− (>>=) x f = x *> f unit
35+ bind x f = x *> f unit
36
36
37main = do
37main = do
38 Debug.Trace.trace example1
38 Debug.Trace.trace example1
examples/passing/Superclasses3.purs+1−1
@@ -31,7 +31,7 @@ instance applicativeMTrace :: Applicative MTrace where
31 pure = MTrace <<< return
31 pure = MTrace <<< return
32
32
33instance bindMTrace :: Bind MTrace where
33instance bindMTrace :: Bind MTrace where
34− (>>=) m f = MTrace (runMTrace m >>= (runMTrace <<< f))
34+ bind m f = MTrace (runMTrace m >>= (runMTrace <<< f))
35
35
36instance monadMTrace :: Monad MTrace
36instance monadMTrace :: Monad MTrace
37
37
examples/passing/TypeClasses.purs+3−3
@@ -31,7 +31,7 @@ instance applicativeData :: Applicative Data where
31 pure = Data
31 pure = Data
32
32
33instance bindData :: Bind Data where
33instance bindData :: Bind Data where
34− (>>=) (Data a) f = f a
34+ bind (Data a) f = f a
35
35
36instance monadData :: Monad Data
36instance monadData :: Monad Data
37
37
@@ -47,8 +47,8 @@ instance applicativeMaybe :: Applicative Maybe where
47 pure = Just
47 pure = Just
48
48
49instance bindMaybe :: Bind Maybe where
49instance bindMaybe :: Bind Maybe where
50− (>>=) Nothing _ = Nothing
50+ bind Nothing _ = Nothing
51− (>>=) (Just a) f = f a
51+ bind (Just a) f = f a
52
52
53instance monadMaybe :: Monad Maybe
53instance monadMaybe :: Monad Maybe
54
54
tests/prelude/Prelude.purs+7−4
@@ -17,7 +17,7 @@ module Prelude
17 , Functor, (<$>), (<#>), void
17 , Functor, (<$>), (<#>), void
18 , Apply, (<*>)
18 , Apply, (<*>)
19 , Applicative, pure, liftA1
19 , Applicative, pure, liftA1
20− , Bind, (>>=)
20+ , Bind, bind, (>>=)
21 , Monad, return, liftM1, ap
21 , Monad, return, liftM1, ap
22 , Semigroup, (<>), (++)
22 , Semigroup, (<>), (++)
23 , Semiring, (+), zero, (*), one
23 , Semiring, (+), zero, (*), one
@@ -127,12 +127,15 @@ module Prelude
127 liftA1 f a = pure f <*> a
127 liftA1 f a = pure f <*> a
128
128
129 infixl 1 >>=
129 infixl 1 >>=
130+
131+ (>>=) :: forall m a b. (Bind m) => m a -> (a -> m b) -> m b
132+ (>>=) = bind
130
133
131 class (Apply m) <= Bind m where
134 class (Apply m) <= Bind m where
132− (>>=) :: forall a b. m a -> (a -> m b) -> m b
135+ bind :: forall a b. m a -> (a -> m b) -> m b
133
136
134 instance bindArr :: Bind ((->) r) where
137 instance bindArr :: Bind ((->) r) where
135− (>>=) m f x = f (m x) x
138+ bind m f x = f (m x) x
136
139
137 class (Applicative m, Bind m) <= Monad m
140 class (Applicative m, Bind m) <= Monad m
138
141
@@ -585,7 +588,7 @@ module Control.Monad.Eff
585 pure = returnE
588 pure = returnE
586
589
587 instance bindEff :: Bind (Eff e) where
590 instance bindEff :: Bind (Eff e) where
588− (>>=) = bindE
591+ bind = bindE
589
592
590 instance monadEff :: Monad (Eff e)
593 instance monadEff :: Monad (Eff e)
591
594