forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCrash.hs
More file actions
27 lines (22 loc) · 794 Bytes
/
Crash.hs
File metadata and controls
27 lines (22 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE CPP #-}
{-# LANGUAGE ImplicitParams #-}
module Language.PureScript.Crash where
import Prelude.Compat
import qualified GHC.Stack
-- | A compatibility wrapper for the @GHC.Stack.HasCallStack@ constraint.
#if __GLASGOW_HASKELL__ >= 800
type HasCallStack = GHC.Stack.HasCallStack
#elif MIN_VERSION_GLASGOW_HASKELL(7,10,2,0)
type HasCallStack = (?callStack :: GHC.Stack.CallStack)
#else
import GHC.Exts (Constraint)
-- CallStack wasn't present in GHC 7.10.1
type HasCallStack = (() :: Constraint)
#endif
-- | Exit with an error message and a crash report link.
internalError :: HasCallStack => String -> a
internalError =
error
. ("An internal error occurred during compilation: " ++)
. (++ "\nPlease report this at https://github.com/purescript/purescript/issues")
. show