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

Add unsafePerformEff #9

Merged
merged 1 commit into from
Nov 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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