1{-# LANGUAGE CPP, NoImplicitPrelude #-}
2#if __GLASGOW_HASKELL__ >= 702
3{-# LANGUAGE Trustworthy #-}
4#endif
5#if MIN_VERSION_base(4,10,0)
6{-# LANGUAGE MagicHash #-}
7{-# LANGUAGE RankNTypes #-}
8{-# LANGUAGE TypeInType #-}
9#endif
10module Control.Exception.Compat (
11  module Base
12, throw
13) where
14
15import Control.Exception as Base
16#if MIN_VERSION_base(4,10,0) && !(MIN_VERSION_base(4,12,0))
17  hiding (throw)
18import GHC.Exts (RuntimeRep, TYPE, raise#)
19
20-- | Throw an exception.  Exceptions may be thrown from purely
21-- functional code, but may only be caught within the 'IO' monad.
22throw :: forall (r :: RuntimeRep). forall (a :: TYPE r). forall e.
23         Exception e => e -> a
24throw e = raise# (toException e)
25#endif
26