Move throw to Unsafe exports.

This commit is contained in:
Stephen Diehl
2016-06-30 18:48:55 -04:00
parent 89fdc587e0
commit b8479ebcb5
3 changed files with 11 additions and 1 deletions
+2
View File
@@ -6,6 +6,8 @@
* Removes ``string-conv`` dependency so Stack build works without ``extra-deps``.
* Brings ``Callstack`` machinery in for GHC 8.x.
* Removes ``throw`` and ``assert`` from ``Control.Exception`` exports.
* Removes ``unsafeShiftL`` and ``unsafeShiftR`` from ``Data.Bits`` exports.
* Reexport ``throw`` as ``unsafeThrow`` via Unsafe module.
0.1.5
=====
+4 -1
View File
@@ -230,7 +230,10 @@ import Control.Monad.Trans as X (
-- Base types
import Data.Int as X
import Data.Bits as X
import Data.Bits as X hiding (
unsafeShiftL
, unsafeShiftR
)
import Data.Word as X
import Data.Either as X
import Data.Complex as X
+5
View File
@@ -8,9 +8,11 @@ module Unsafe (
unsafeLast,
unsafeFromJust,
unsafeIndex,
unsafeThrow,
) where
import Base (Int)
import Control.Exception as Exc
import qualified Data.List as List
import qualified Data.Maybe as Maybe
@@ -31,3 +33,6 @@ unsafeFromJust = Maybe.fromJust
unsafeIndex :: [a] -> Int -> a
unsafeIndex = (List.!!)
unsafeThrow :: Exc.Exception e => e -> a
unsafeThrow = Exc.throw