File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
docs/Control/Monad/Eff/Exception
src/Control/Monad/Eff/Exception Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 2020 " package.json"
2121 ],
2222 "dependencies" : {
23- "purescript-eff" : " ^0.1.0 "
23+ "purescript-eff" : " ^0.1.2 "
2424 }
2525}
Original file line number Diff line number Diff line change 1+ ## Module Control.Monad.Eff.Exception.Unsafe
2+
3+ #### ` unsafeThrowException `
4+
5+ ``` purescript
6+ unsafeThrowException :: forall a. Error -> a
7+ ```
8+
9+ Throw an exception in pure code. This function should be used very
10+ sparingly, as it can cause unexpected crashes at runtime.
11+
12+ #### ` unsafeThrow `
13+
14+ ``` purescript
15+ unsafeThrow :: forall a. String -> a
16+ ```
17+
18+ Defined as ` unsafeThrowException <<< error ` .
19+
20+
Original file line number Diff line number Diff line change 1+ module Control.Monad.Eff.Exception.Unsafe where
2+
3+ import Prelude
4+ import Control.Monad.Eff
5+ import Control.Monad.Eff.Unsafe
6+ import Control.Monad.Eff.Exception
7+
8+ -- | Throw an exception in pure code. This function should be used very
9+ -- | sparingly, as it can cause unexpected crashes at runtime.
10+ unsafeThrowException :: forall a . Error -> a
11+ unsafeThrowException = unsafePerformEff <<< throwException
12+
13+ -- | Defined as `unsafeThrowException <<< error`.
14+ unsafeThrow :: forall a . String -> a
15+ unsafeThrow = unsafeThrowException <<< error
You can’t perform that action at this time.
0 commit comments