Fix seq on global names

This commit is contained in:
Chris Done 2019-11-21 10:18:49 +00:00
parent 2374f0f720
commit 260a92f46c
2 changed files with 41 additions and 2 deletions

View File

@ -272,7 +272,7 @@ match = go [0]
isWhnf :: Expression Type i l -> Bool
isWhnf =
\case
VariableExpression {} -> True
VariableExpression {} -> False
ConstructorExpression {} -> True
ConstantExpression {} -> True
LiteralExpression {} -> True

View File

@ -76,4 +76,43 @@ spec =
}))
(LiteralExpression () (IntegerLiteral 1))
, LiteralExpression () (IntegerLiteral 1)
])))
]))
it
"Seq"
(shouldBe
(second
last
(first
(const ())
(runNoLoggingT
((evalSupplyT
(do decls <-
parseText
"test"
"seq =\n\
\ \\x y ->\n\
\ case x of\n\
\ !_ -> y\n\
\loop = loop\n\
\main = seq loop 1"
(binds, ctx) <- createContext decls
things <-
execWriterT
(runStepper
100
ctx
(fmap (fmap typeSignatureA) binds)
"main")
pure things)
[1 ..])))))
(Right
((CaseExpression
()
(VariableExpression () (ValueName 42 "loop"))
[ CaseAlt
{ caseAltLabel = ()
, caseAltPattern = BangPattern (WildcardPattern () "_")
, caseAltExpression =
LiteralExpression () (IntegerLiteral 1)
}
])))))