git.iko.soy/rowtype-yoga/purescript-native
on ff4866a help sign in
27 lines 794 B history raw
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE ImplicitParams #-}
4module Language.PureScript.Crash where
6import Prelude.Compat
8import qualified GHC.Stack
10-- | A compatibility wrapper for the @GHC.Stack.HasCallStack@ constraint.
11#if __GLASGOW_HASKELL__ >= 800
12type HasCallStack = GHC.Stack.HasCallStack
13#elif MIN_VERSION_GLASGOW_HASKELL(7,10,2,0)
14type HasCallStack = (?callStack :: GHC.Stack.CallStack)
15#else
16import GHC.Exts (Constraint)
17-- CallStack wasn't present in GHC 7.10.1
18type HasCallStack = (() :: Constraint)
19#endif
21-- | Exit with an error message and a crash report link.
22internalError :: HasCallStack => String -> a
23internalError =
24 error
25 . ("An internal error occurred during compilation: " ++)
26 . (++ "\nPlease report this at https://github.com/purescript/purescript/issues")
27 . show