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

Commit 972d5fb

Browse files
committed
Merge pull request #7 from jbrownson/master
make type Pure use an empty row instead of rank-2 types
2 parents f914b2e + 1c6bf7d commit 972d5fb

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

docs/Control/Monad/Eff.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ instance monadEff :: Monad (Eff e)
2424
#### `Pure`
2525

2626
``` purescript
27-
type Pure a = forall e. Eff e a
27+
type Pure a = Eff () a
2828
```
2929

3030
The `Pure` type synonym represents _pure_ computations, i.e. ones in which all effects have been handled.
@@ -39,9 +39,6 @@ runPure :: forall a. Pure a -> a
3939

4040
Run a pure computation and return its result.
4141

42-
Note: since this function has a rank-2 type, it may cause problems to apply this function using the `$` operator. The recommended approach
43-
is to use parentheses instead.
44-
4542
#### `untilE`
4643

4744
``` purescript

src/Control/Monad/Eff.purs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ foreign import bindE :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
2121
-- | The `Pure` type synonym represents _pure_ computations, i.e. ones in which all effects have been handled.
2222
-- |
2323
-- | The `runPure` function can be used to run pure computations and obtain their result.
24-
type Pure a = forall e. Eff e a
24+
type Pure a = Eff () a
2525

2626
-- | Run a pure computation and return its result.
27-
-- |
28-
-- | Note: since this function has a rank-2 type, it may cause problems to apply this function using the `$` operator. The recommended approach
29-
-- | is to use parentheses instead.
3027
foreign import runPure :: forall a. Pure a -> a
3128

3229
instance functorEff :: Functor (Eff e) where

0 commit comments

Comments
 (0)