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

Commit 2c81248

Browse files
committed
Merge pull request #9 from hdgarrood/unsafe-perform
Add unsafePerformEff
2 parents 972d5fb + 95b6a86 commit 2c81248

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/Control/Monad/Eff/Unsafe.md

+9
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@ Change the type of an effectful computation, allowing it to be run in another co
1010

1111
Note: use of this function can result in arbitrary side-effects.
1212

13+
#### `unsafePerformEff`
14+
15+
``` purescript
16+
unsafePerformEff :: forall eff a. Eff eff a -> a
17+
```
18+
19+
Run an effectful computation. Note: use of this function can result in
20+
arbitrary side-effects.
21+
1322

src/Control/Monad/Eff/Unsafe.purs

+5
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ import Control.Monad.Eff
88
-- |
99
-- | Note: use of this function can result in arbitrary side-effects.
1010
foreign import unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
11+
12+
-- | Run an effectful computation. Note: use of this function can result in
13+
-- | arbitrary side-effects.
14+
unsafePerformEff :: forall eff a. Eff eff a -> a
15+
unsafePerformEff = runPure <<< unsafeInterleaveEff

0 commit comments

Comments
 (0)