Move throw to Unsafe exports.
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
* Removes ``string-conv`` dependency so Stack build works without ``extra-deps``.
|
* Removes ``string-conv`` dependency so Stack build works without ``extra-deps``.
|
||||||
* Brings ``Callstack`` machinery in for GHC 8.x.
|
* Brings ``Callstack`` machinery in for GHC 8.x.
|
||||||
* Removes ``throw`` and ``assert`` from ``Control.Exception`` exports.
|
* 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
|
0.1.5
|
||||||
=====
|
=====
|
||||||
|
|||||||
+4
-1
@@ -230,7 +230,10 @@ import Control.Monad.Trans as X (
|
|||||||
|
|
||||||
-- Base types
|
-- Base types
|
||||||
import Data.Int as X
|
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.Word as X
|
||||||
import Data.Either as X
|
import Data.Either as X
|
||||||
import Data.Complex as X
|
import Data.Complex as X
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ module Unsafe (
|
|||||||
unsafeLast,
|
unsafeLast,
|
||||||
unsafeFromJust,
|
unsafeFromJust,
|
||||||
unsafeIndex,
|
unsafeIndex,
|
||||||
|
unsafeThrow,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Base (Int)
|
import Base (Int)
|
||||||
|
import Control.Exception as Exc
|
||||||
import qualified Data.List as List
|
import qualified Data.List as List
|
||||||
import qualified Data.Maybe as Maybe
|
import qualified Data.Maybe as Maybe
|
||||||
|
|
||||||
@@ -31,3 +33,6 @@ unsafeFromJust = Maybe.fromJust
|
|||||||
|
|
||||||
unsafeIndex :: [a] -> Int -> a
|
unsafeIndex :: [a] -> Int -> a
|
||||||
unsafeIndex = (List.!!)
|
unsafeIndex = (List.!!)
|
||||||
|
|
||||||
|
unsafeThrow :: Exc.Exception e => e -> a
|
||||||
|
unsafeThrow = Exc.throw
|
||||||
|
|||||||
Reference in New Issue
Block a user