File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 17
17
" package.json"
18
18
],
19
19
"dependencies" : {
20
- "purescript-prelude" : " ^3.0.0"
20
+ "purescript-prelude" : " ^3.0.0" ,
21
+ "purescript-monoid" : " ^3.3.0"
21
22
}
22
23
}
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ module Effect
4
4
) where
5
5
6
6
import Control.Applicative (class Applicative , liftA1 )
7
- import Control.Apply (class Apply )
7
+ import Control.Apply (class Apply , lift2 )
8
8
import Control.Bind (class Bind )
9
9
import Control.Monad (class Monad , ap )
10
10
11
11
import Data.Functor (class Functor )
12
+ import Data.Monoid (class Monoid , mempty )
13
+ import Data.Semigroup (class Semigroup , append )
12
14
import Data.Unit (Unit )
13
15
14
16
-- | The `Effect` type constructor is used to represent _native_ effects.
@@ -28,6 +30,12 @@ instance applyEffect :: Apply Effect where
28
30
instance applicativeEffect :: Applicative Effect where
29
31
pure = pureE
30
32
33
+ instance semigroupEffect :: Semigroup a => Semigroup (Effect a ) where
34
+ append = lift2 append
35
+
36
+ instance monoidEffect :: Monoid a => Monoid (Effect a ) where
37
+ mempty = pureE mempty
38
+
31
39
foreign import pureE :: forall a . a -> Effect a
32
40
33
41
instance bindEffect :: Bind Effect where
You can’t perform that action at this time.
0 commit comments