diff options
Diffstat (limited to 'compiler/basicTypes/UniqSupply.hs')
-rw-r--r-- | compiler/basicTypes/UniqSupply.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/basicTypes/UniqSupply.hs b/compiler/basicTypes/UniqSupply.hs index da1a924736..664600147e 100644 --- a/compiler/basicTypes/UniqSupply.hs +++ b/compiler/basicTypes/UniqSupply.hs @@ -29,7 +29,10 @@ module UniqSupply ( initUniqSupply ) where +import GhcPrelude + import Unique +import Panic (panic) import GHC.IO @@ -37,6 +40,7 @@ import MonadUtils import Control.Monad import Data.Bits import Data.Char +import Control.Monad.Fail #include "Unique.h" @@ -145,6 +149,10 @@ instance Applicative UniqSM where (# xx, us'' #) -> (# ff xx, us'' #) (*>) = thenUs_ +-- TODO: try to get rid of this instance +instance MonadFail UniqSM where + fail = panic + -- | Run the 'UniqSM' action, returning the final 'UniqSupply' initUs :: UniqSupply -> UniqSM a -> (a, UniqSupply) initUs init_us m = case unUSM m init_us of { (# r, us #) -> (r,us) } |