Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 48bd3a6

Browse files
committed
Add effect kind
1 parent f72d54d commit 48bd3a6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/Control/Monad/Eff.purs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Control.Monad.Eff
2-
( Eff
2+
( kind Effect
3+
, Eff
34
, Pure
45
, runPure
56
, untilE, whileE, forE, foreachE
@@ -13,6 +14,17 @@ import Control.Monad (class Monad, ap)
1314
import Data.Functor (class Functor)
1415
import Data.Unit (Unit)
1516

17+
-- | The kind of all effect types.
18+
-- |
19+
-- | Declare new effect types using `foreign data` declarations, as follows:
20+
-- |
21+
-- | ```purescript
22+
-- | import Control.Monad.Eff (kind Effect)
23+
-- |
24+
-- | foreign import data MyEffect :: Effect
25+
-- | ```
26+
foreign import kind Effect
27+
1628
-- | The `Eff` type constructor is used to represent _native_ effects.
1729
-- |
1830
-- | See [Handling Native Effects with the Eff Monad](http://www.purescript.org/learn/eff/)
@@ -21,7 +33,7 @@ import Data.Unit (Unit)
2133
-- | The first type parameter is a row of effects which represents the contexts
2234
-- | in which a computation can be run, and the second type parameter is the
2335
-- | return type.
24-
foreign import data Eff :: # ! -> * -> *
36+
foreign import data Eff :: # Effect -> Type -> Type
2537

2638
instance functorEff :: Functor (Eff e) where
2739
map = liftA1

0 commit comments

Comments
 (0)