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 1717 " package.json"
1818 ],
1919 "dependencies" : {
20- "purescript-prelude" : " ^3.0.0"
20+ "purescript-prelude" : " ^3.0.0" ,
21+ "purescript-monoid" : " ^3.3.0"
2122 }
2223}
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ module Effect
44 ) where
55
66import Control.Applicative (class Applicative , liftA1 )
7- import Control.Apply (class Apply )
7+ import Control.Apply (class Apply , lift2 )
88import Control.Bind (class Bind )
99import Control.Monad (class Monad , ap )
1010
1111import Data.Functor (class Functor )
12+ import Data.Monoid (class Monoid , mempty )
13+ import Data.Semigroup (class Semigroup , append )
1214import Data.Unit (Unit )
1315
1416-- | The `Effect` type constructor is used to represent _native_ effects.
@@ -28,6 +30,12 @@ instance applyEffect :: Apply Effect where
2830instance applicativeEffect :: Applicative Effect where
2931 pure = pureE
3032
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+
3139foreign import pureE :: forall a . a -> Effect a
3240
3341instance bindEffect :: Bind Effect where
You can’t perform that action at this time.
0 commit comments