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

Commit

Permalink
Merge pull request #9 from hdgarrood/unsafe-perform
Browse files Browse the repository at this point in the history
Add unsafePerformEff
  • Loading branch information
paf31 committed Nov 8, 2015
2 parents 972d5fb + 95b6a86 commit 2c81248
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/Control/Monad/Eff/Unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ Change the type of an effectful computation, allowing it to be run in another co

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

#### `unsafePerformEff`

``` purescript
unsafePerformEff :: forall eff a. Eff eff a -> a
```

Run an effectful computation. Note: use of this function can result in
arbitrary side-effects.


5 changes: 5 additions & 0 deletions src/Control/Monad/Eff/Unsafe.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ import Control.Monad.Eff
-- |
-- | Note: use of this function can result in arbitrary side-effects.
foreign import unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a

-- | Run an effectful computation. Note: use of this function can result in
-- | arbitrary side-effects.
unsafePerformEff :: forall eff a. Eff eff a -> a
unsafePerformEff = runPure <<< unsafeInterleaveEff

0 comments on commit 2c81248

Please sign in to comment.