Skip to content

Commit

Permalink
Merge branch 'maint-2.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Oct 18, 2015
2 parents 46e2c6b + 746e230 commit dfb02a5
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/full/Agda/TypeChecking/Monad/Builtin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,13 @@ constructorForm :: Term -> TCM Term
constructorForm v = constructorForm' primZero primSuc v

constructorForm' :: Applicative m => m Term -> m Term -> Term -> m Term
constructorForm' pZero pSuc v = case ignoreSharing v of
{- 2012-04-02 changed semantics of DontCare
-- Andreas, 2011-10-03, the following line restores IrrelevantLevel
DontCare v -> constructorForm v
-}
Lit (LitInt r n) -> cons (Lit . LitInt r) n
-- Level (Max []) -> primLevelZero
-- Level (Max [ClosedLevel n]) -> cons primLevelZero primLevelSuc (Level . Max . (:[]) . ClosedLevel) n
_ -> pure v
where
cons lit n
| n == 0 = pZero
| n > 0 = (`apply` [defaultArg $ lit $ n - 1]) <$> pSuc
| otherwise = pure v
constructorForm' pZero pSuc v =
case ignoreSharing v of
Lit (LitInt r n)
| n == 0 -> pZero
| n > 0 -> (`apply` [defaultArg $ Lit $ LitInt r $ n - 1]) <$> pSuc
| otherwise -> pure v
_ -> pure v

---------------------------------------------------------------------------
-- * The names of built-in things
Expand Down

0 comments on commit dfb02a5

Please sign in to comment.