mirror of
https://github.com/chrisdone/duet.git
synced 2025-01-06 22:09:02 +03:00
Fix seq on global names
This commit is contained in:
parent
2374f0f720
commit
260a92f46c
@ -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
|
||||
|
41
test/Spec.hs
41
test/Spec.hs
@ -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)
|
||||
}
|
||||
])))))
|
||||
|
Loading…
Reference in New Issue
Block a user