Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions dhall/src/Dhall/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,10 @@ eval !env t0 =
-- https://github.com/ghcjs/ghcjs/issues/782
go zero (fromIntegral n' :: Integer) where
go !acc 0 = acc
go (VNaturalLit x) m =
case vApp succ (VNaturalLit x) of
VNaturalLit y | x == y -> VNaturalLit x
notNaturalLit -> go notNaturalLit (m - 1)
go acc m = go (vApp succ acc) (m - 1)
go acc m =
-- Detect a shortcut: if succ acc == acc then return acc immediately.
let next = vApp succ acc
in if conv env next acc then acc else go next (m - 1)
_ -> inert
NaturalBuild ->
VPrim $ \case
Expand Down