ref: 1deadc8274c2a9b8504f056875148adc2314b412
parent: 87ef40cad20f07127917a64f6f312be1f97ff2f9
author: Lennart Augustsson <lennart@augustsson.net>
date: Sun Sep 3 14:07:29 EDT 2023
Move kType.
--- a/src/MicroHs/Expr.hs
+++ b/src/MicroHs/Expr.hs
@@ -14,7 +14,7 @@
ECaseArm,
EType,
EPat, patVars, isPVar, isPConApp,
- EKind,
+ EKind, kType,
IdKind(..), idKindIdent,
LHS,
Constr,
@@ -180,6 +180,9 @@
type EKind = EType
+kType :: EKind
+kType = EVar (Ident noSLoc "Primitives.Type")
+
tupleConstr :: Int -> Ident
tupleConstr n = mkIdent (replicate (n - 1) ',')
@@ -255,7 +258,8 @@
getSLocExpr :: Expr -> SLoc
getSLocExpr e = head $ map getSLocIdent (allVarsExpr e) ++ [noSLoc]
-errorMessage :: forall a . SLoc -> String -> a
+errorMessage :: --XHasCallStack =>
+ forall a . SLoc -> String -> a
errorMessage loc msg = error $ showSLoc loc ++ msg
----------------
--- a/src/MicroHs/Parse.hs
+++ b/src/MicroHs/Parse.hs
@@ -255,9 +255,6 @@
pKind :: P EKind
pKind = pType
-kType :: EKind
-kType = EVar (Ident noSLoc "Type")
-
pTypeScheme :: P ETypeScheme
pTypeScheme = P.do
vs <- (pKeyword "forall" *> esome pIdKind <* pSymbol ".") <|< pure []
--
⑨