@@ -952,16 +952,16 @@ expandParams dec ps ns infs tm = en tm
952 mkShadow (MN i n) = MN (i+1) n
952 mkShadow (MN i n) = MN (i+1) n
953 mkShadow (NS x s) = NS (mkShadow x) s
953 mkShadow (NS x s) = NS (mkShadow x) s
955− en (PLam fc n t s)
955+ en (PLam fc n nfc t s)
956 | n `elem` (map fst ps ++ ns)
956 | n `elem` (map fst ps ++ ns)
957 = let n' = mkShadow n in
957 = let n' = mkShadow n in
958− PLam fc n' (en t) (en (shadow n n' s))
958+ PLam fc n' nfc (en t) (en (shadow n n' s))
959− | otherwise = PLam fc n (en t) (en s)
959+ | otherwise = PLam fc n nfc (en t) (en s)
960− en (PPi p n t s)
960+ en (PPi p n nfc t s)
961 | n `elem` (map fst ps ++ ns)
961 | n `elem` (map fst ps ++ ns)
962 = let n' = mkShadow n in -- TODO THINK SHADOWING TacImp?
962 = let n' = mkShadow n in -- TODO THINK SHADOWING TacImp?
963− PPi (enTacImp p) n' (en t) (en (shadow n n' s))
963+ PPi (enTacImp p) n' nfc (en t) (en (shadow n n' s))
964− | otherwise = PPi (enTacImp p) n (en t) (en s)
964+ | otherwise = PPi (enTacImp p) n nfc (en t) (en s)
965 en (PLet fc n ty v s)
965 en (PLet fc n ty v s)
966 | n `elem` (map fst ps ++ ns)
966 | n `elem` (map fst ps ++ ns)
967 = let n' = mkShadow n in
967 = let n' = mkShadow n in
@@ -1136,7 +1136,7 @@ getPriority i tm = 1 -- pri tm
1136 ((P (TCon _ _) _ _):_) -> 1
1136 ((P (TCon _ _) _ _):_) -> 1
1137 ((P Ref _ _):_) -> 1
1137 ((P Ref _ _):_) -> 1
1138 [] -> 0 -- must be locally bound, if it's not an error...
1138 [] -> 0 -- must be locally bound, if it's not an error...
1139− pri (PPi _ _ x y) = max 5 (max (pri x) (pri y))
1139+ pri (PPi _ _ _ x y) = max 5 (max (pri x) (pri y))
1140 pri (PTrue _ _) = 0
1140 pri (PTrue _ _) = 0
1141 pri (PRefl _ _) = 1
1141 pri (PRefl _ _) = 1
1142 pri (PEq _ _ _ l r) = max 1 (max (pri l) (pri r))
1142 pri (PEq _ _ _ l r) = max 1 (max (pri l) (pri r))
@@ -1182,10 +1182,10 @@ addStatics n tm ptm =
1182 putIState $ i { idris_statics = addDef n stpos (idris_statics i) }
1182 putIState $ i { idris_statics = addDef n stpos (idris_statics i) }
1183 addIBC (IBCStatic n)
1183 addIBC (IBCStatic n)
1185− initStatics (Bind n (Pi _ ty _) sc) (PPi p n' t s)
1185+ initStatics (Bind n (Pi _ ty _) sc) (PPi p n' fc t s)
1186− | n /= n' = let (static, dynamic) = initStatics sc (PPi p n' t s) in
1186+ | n /= n' = let (static, dynamic) = initStatics sc (PPi p n' fc t s) in
1187 (static, (n, ty) : dynamic)
1187 (static, (n, ty) : dynamic)
1188− initStatics (Bind n (Pi _ ty _) sc) (PPi p n' _ s)
1188+ initStatics (Bind n (Pi _ ty _) sc) (PPi p n' fc _ s)
1189 = let (static, dynamic) = initStatics (instantiate (P Bound n ty) sc) s in
1189 = let (static, dynamic) = initStatics (instantiate (P Bound n ty) sc) s in
1190 if pstatic p == Static then ((n, ty) : static, dynamic)
1190 if pstatic p == Static then ((n, ty) : static, dynamic)
1191 else if (not (searchArg p))
1191 else if (not (searchArg p))
@@ -1254,16 +1254,16 @@ addUsingConstraints syn fc t
1254 -- if all of args in ns, then add it
1254 -- if all of args in ns, then add it
1255 doAdd (UConstraint c args : cs) ns t
1255 doAdd (UConstraint c args : cs) ns t
1256 | all (\n -> elem n ns) args
1256 | all (\n -> elem n ns) args
1257− = PPi (Constraint [] Dynamic) (sMN 0 "cu")
1257+ = PPi (Constraint [] Dynamic) (sMN 0 "cu") NoFC
1258 (mkConst c args) (doAdd cs ns t)
1258 (mkConst c args) (doAdd cs ns t)
1259 | otherwise = doAdd cs ns t
1259 | otherwise = doAdd cs ns t
1261 mkConst c args = PApp fc (PRef fc c)
1261 mkConst c args = PApp fc (PRef fc c)
1262 (map (\n -> PExp 0 [] (sMN 0 "carg") (PRef fc n)) args)
1262 (map (\n -> PExp 0 [] (sMN 0 "carg") (PRef fc n)) args)
1264− getConstraints (PPi (Constraint _ _) _ c sc)
1264+ getConstraints (PPi (Constraint _ _) _ _ c sc)
1265 = getcapp c ++ getConstraints sc
1265 = getcapp c ++ getConstraints sc
1266− getConstraints (PPi _ _ c sc) = getConstraints sc
1266+ getConstraints (PPi _ _ _ c sc) = getConstraints sc
1267 getConstraints _ = []
1267 getConstraints _ = []
1269 getcapp (PApp _ (PRef _ c) args)
1269 getcapp (PApp _ (PRef _ c) args)
@@ -1300,7 +1300,7 @@ addUsingImpls syn n fc t
1300 -- if all of args in ns, then add it
1300 -- if all of args in ns, then add it
1301 doAdd (UImplicit n ty : cs) ns t
1301 doAdd (UImplicit n ty : cs) ns t
1302 | elem n ns
1302 | elem n ns
1303− = PPi (Imp [] Dynamic False Nothing) n ty (doAdd cs ns t)
1303+ = PPi (Imp [] Dynamic False Nothing) n NoFC ty (doAdd cs ns t)
1304 | otherwise = doAdd cs ns t
1304 | otherwise = doAdd cs ns t
1306 -- bind the free names which weren't in the using block
1306 -- bind the free names which weren't in the using block
@@ -1308,9 +1308,9 @@ addUsingImpls syn n fc t
1308 bindFree (n:ns) tm
1308 bindFree (n:ns) tm
1309 | elem n (map iname uimpls) = bindFree ns tm
1309 | elem n (map iname uimpls) = bindFree ns tm
1310 | otherwise
1310 | otherwise
1311− = PPi (Imp [] Dynamic False Nothing) n Placeholder (bindFree ns tm)
1311+ = PPi (Imp [] Dynamic False Nothing) n NoFC Placeholder (bindFree ns tm)
1313− getArgnames (PPi _ n c sc)
1313+ getArgnames (PPi _ n _ c sc)
1314 = n : getArgnames sc
1314 = n : getArgnames sc
1315 getArgnames _ = []
1315 getArgnames _ = []
@@ -1319,7 +1319,7 @@ addUsingImpls syn n fc t
1320getUnboundImplicits :: IState -> Type -> PTerm -> [(Bool, PArg)]
1320getUnboundImplicits :: IState -> Type -> PTerm -> [(Bool, PArg)]
1321getUnboundImplicits i t tm = getImps t (collectImps tm)
1321getUnboundImplicits i t tm = getImps t (collectImps tm)
1322− where collectImps (PPi p n t sc)
1322+ where collectImps (PPi p n _ t sc)
1323 = (n, (p, t)) : collectImps sc
1323 = (n, (p, t)) : collectImps sc
1324 collectImps _ = []
1324 collectImps _ = []
@@ -1419,13 +1419,13 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
1419 = do (decls, ns) <- get
1419 = do (decls, ns) <- get
1420 let isn = concatMap (namesIn uvars ist) (map getTm as)
1420 let isn = concatMap (namesIn uvars ist) (map getTm as)
1421 put (decls, nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1421 put (decls, nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1422− imps top env (PPi (Imp l _ _ _) n ty sc)
1422+ imps top env (PPi (Imp l _ _ _) n _ ty sc)
1423 = do let isn = nub (implNamesIn uvars ty) `dropAll` [n]
1423 = do let isn = nub (implNamesIn uvars ty) `dropAll` [n]
1424 (decls , ns) <- get
1424 (decls , ns) <- get
1425 put (PImp (getPriority ist ty) True l n Placeholder : decls,
1425 put (PImp (getPriority ist ty) True l n Placeholder : decls,
1426 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1426 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1427 imps True (n:env) sc
1427 imps True (n:env) sc
1428− imps top env (PPi (Exp l _ _) n ty sc)
1428+ imps top env (PPi (Exp l _ _) n _ ty sc)
1429 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1429 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1430 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1430 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1431 _ -> [])
1431 _ -> [])
@@ -1433,7 +1433,7 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
1433 put (PExp (getPriority ist ty) l n Placeholder : decls,
1433 put (PExp (getPriority ist ty) l n Placeholder : decls,
1434 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1434 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1435 imps True (n:env) sc
1435 imps True (n:env) sc
1436− imps top env (PPi (Constraint l _) n ty sc)
1436+ imps top env (PPi (Constraint l _) n _ ty sc)
1437 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1437 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1438 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1438 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1439 _ -> [])
1439 _ -> [])
@@ -1441,7 +1441,7 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
1441 put (PConstraint 10 l n Placeholder : decls,
1441 put (PConstraint 10 l n Placeholder : decls,
1442 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1442 nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1443 imps True (n:env) sc
1443 imps True (n:env) sc
1444− imps top env (PPi (TacImp l _ scr) n ty sc)
1444+ imps top env (PPi (TacImp l _ scr) n _ ty sc)
1445 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1445 = do let isn = nub (implNamesIn uvars ty ++ case sc of
1446 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1446 (PRef _ x) -> namesIn uvars ist sc `dropAll` [n]
1447 _ -> [])
1447 _ -> [])
@@ -1476,7 +1476,7 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
1476 = do (decls, ns) <- get
1476 = do (decls, ns) <- get
1477 let isn = concatMap (namesIn uvars ist) as
1477 let isn = concatMap (namesIn uvars ist) as
1478 put (decls, nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1478 put (decls, nub (ns ++ (isn `dropAll` (env ++ map fst (getImps decls)))))
1479− imps top env (PLam fc n ty sc)
1479+ imps top env (PLam fc n _ ty sc)
1480 = do imps False env ty
1480 = do imps False env ty
1481 imps False (n:env) sc
1481 imps False (n:env) sc
1482 imps top env (PHidden tm) = imps False env tm
1482 imps top env (PHidden tm) = imps False env tm
@@ -1488,8 +1488,8 @@ implicitise syn ignore ist tm = -- trace ("INCOMING " ++ showImp True tm) $
1488 pibind using [] sc = sc
1488 pibind using [] sc = sc
1489 pibind using (n:ns) sc
1489 pibind using (n:ns) sc
1490 = case lookup n using of
1490 = case lookup n using of
1491− Just ty -> PPi (Imp [] Dynamic False Nothing) n ty (pibind using ns sc)
1491+ Just ty -> PPi (Imp [] Dynamic False Nothing) n NoFC ty (pibind using ns sc)
1492− Nothing -> PPi (Imp [] Dynamic False Nothing) n Placeholder
1492+ Nothing -> PPi (Imp [] Dynamic False Nothing) n NoFC Placeholder
1493 (pibind using ns sc)
1493 (pibind using ns sc)
1495-- Add implicit arguments in function calls
1495-- Add implicit arguments in function calls
@@ -1572,18 +1572,20 @@ addImpl' inpat env infns imp_meths ist ptm
1572 -- definition which is passed through addImpl again with more scope
1572 -- definition which is passed through addImpl again with more scope
1573 -- information
1573 -- information
1574 PCase fc c' os
1574 PCase fc c' os
1575− -- If the name in a lambda is a constructor name, do this as a 'case'
1575+
1576− -- instead (it is harmless to do so, especially since the lambda will
1577− -- be lifted anyway!)
1578 ai qq env ds (PIfThenElse fc c t f) = PIfThenElse fc (ai qq env ds c)
1576 ai qq env ds (PIfThenElse fc c t f) = PIfThenElse fc (ai qq env ds c)
1579 (ai qq env ds t)
1577 (ai qq env ds t)
1580 (ai qq env ds f)
1578 (ai qq env ds f)
1580+ -- If the name in a lambda is a constructor name, do this as a 'case'
1581+ -- instead (it is harmless to do so, especially since the lambda will
1582+ -- be lifted anyway!)
1581− ai qq env ds (PLam fc n ty sc)
1583+ ai qq env ds (PLam fc n nfc ty sc)
1582 = case lookupDef n (tt_ctxt ist) of
1584 = case lookupDef n (tt_ctxt ist) of
1583 [] -> let ty' = ai qq env ds ty
1585 [] -> let ty' = ai qq env ds ty
1584 sc' = ai qq ((n, Just ty):env) ds sc in
1586 sc' = ai qq ((n, Just ty):env) ds sc in
1585− PLam fc n ty' sc'
1587+ PLam fc n nfc ty' sc'
1586− _ -> ai qq env ds (PLam fc (sMN 0 "lamp") ty
1588+ _ -> ai qq env ds (PLam fc (sMN 0 "lamp") NoFC ty
1587 (PCase fc (PRef fc (sMN 0 "lamp") )
1589 (PCase fc (PRef fc (sMN 0 "lamp") )
1588 [(PRef fc n, sc)]))
1590 [(PRef fc n, sc)]))
1589 ai qq env ds (PLet fc n ty val sc)
1591 ai qq env ds (PLet fc n ty val sc)
@@ -1593,12 +1595,12 @@ addImpl' inpat env infns imp_meths ist ptm
1593 sc' = ai qq ((n, Just ty):env) ds sc in
1595 sc' = ai qq ((n, Just ty):env) ds sc in
1594 PLet fc n ty' val' sc'
1596 PLet fc n ty' val' sc'
1595 _ -> ai qq env ds (PCase fc val [(PRef fc n, sc)])
1597 _ -> ai qq env ds (PCase fc val [(PRef fc n, sc)])
1596− ai qq env ds (PPi p n ty sc)
1598+ ai qq env ds (PPi p n nfc ty sc)
1597 = let ty' = ai qq env ds ty
1599 = let ty' = ai qq env ds ty
1598 env' = if n `elem` imp_meths then env
1600 env' = if n `elem` imp_meths then env
1599 else ((n, Just ty) : env)
1601 else ((n, Just ty) : env)
1600 sc' = ai qq env' ds sc in
1602 sc' = ai qq env' ds sc in
1601− PPi p n ty' sc'
1603+ PPi p n nfc ty' sc'
1602 ai qq env ds (PGoal fc r n sc)
1604 ai qq env ds (PGoal fc r n sc)
1603 = let r' = ai qq env ds r
1605 = let r' = ai qq env ds r
1604 sc' = ai qq ((n, Nothing):env) ds sc in
1606 sc' = ai qq ((n, Nothing):env) ds sc in
@@ -1808,8 +1810,8 @@ stripUnmatchable i (PApp fc fn args) = PApp fc fn (fmap (fmap su) args) where
1808 else PAlternative b alts'
1810 else PAlternative b alts'
1809 su (PPair fc p l r) = PPair fc p (su l) (su r)
1811 su (PPair fc p l r) = PPair fc p (su l) (su r)
1810 su (PDPair fc p l t r) = PDPair fc p (su l) (su t) (su r)
1812 su (PDPair fc p l t r) = PDPair fc p (su l) (su t) (su r)
1811− su t@(PLam fc _ _ _) = PHidden t
1813+ su t@(PLam _ _ _ _ _) = PHidden t
1812− su t@(PPi _ _ _ _) = PHidden t
1814+ su t@(PPi _ _ _ _ _) = PHidden t
1813 su t@(PEq _ _ _ _ _) = PHidden t
1815 su t@(PEq _ _ _ _ _) = PHidden t
1814 su t = t
1816 su t = t
@@ -1833,7 +1835,7 @@ findStatics :: IState -> PTerm -> (PTerm, [Bool])
1833findStatics ist tm = trace (show tm) $
1835findStatics ist tm = trace (show tm) $
1834 let (ns, ss) = fs tm in
1836 let (ns, ss) = fs tm in
1835 runState (pos ns ss tm) []
1837 runState (pos ns ss tm) []
1836− where fs (PPi p n t sc)
1838+ where fs (PPi p n fc t sc)
1837 | Static <- pstatic p
1839 | Static <- pstatic p
1838 = let (ns, ss) = fs sc in
1840 = let (ns, ss) = fs sc in
1839 (namesIn [] ist t : ns, n : ss)
1841 (namesIn [] ist t : ns, n : ss)
@@ -1843,15 +1845,15 @@ findStatics ist tm = trace (show tm) $
1844 inOne n ns = length (filter id (map (elem n) ns)) == 1
1846 inOne n ns = length (filter id (map (elem n) ns)) == 1
1846− pos ns ss (PPi p n t sc)
1848+ pos ns ss (PPi p n fc t sc)
1847 | elem n ss = do sc' <- pos ns ss sc
1849 | elem n ss = do sc' <- pos ns ss sc
1848 spos <- get
1850 spos <- get
1849 put (True : spos)
1851 put (True : spos)
1850− return (PPi (p { pstatic = Static }) n t sc')
1852+ return (PPi (p { pstatic = Static }) n fc t sc')
1851 | otherwise = do sc' <- pos ns ss sc
1853 | otherwise = do sc' <- pos ns ss sc
1852 spos <- get
1854 spos <- get
1853 put (False : spos)
1855 put (False : spos)
1854− return (PPi p n t sc')
1856+ return (PPi p n fc t sc')
1855 pos ns ss t = return t
1857 pos ns ss t = return t
1857-- for 6.12/7 compatibility
1859-- for 6.12/7 compatibility
@@ -1951,12 +1953,12 @@ matchClause' names i x y = checkRpts $ match (fullApp x) (fullApp y) where
1951 match (PResolveTC _) (PResolveTC _) = return []
1953 match (PResolveTC _) (PResolveTC _) = return []
1952 match (PTrue _ _) (PTrue _ _) = return []
1954 match (PTrue _ _) (PTrue _ _) = return []
1953 match (PReturn _) (PReturn _) = return []
1955 match (PReturn _) (PReturn _) = return []
1954− match (PPi _ _ t s) (PPi _ _ t' s') = do mt <- match' t t'
1956+ match (PPi _ _ _ t s) (PPi _ _ _ t' s') = do mt <- match' t t'
1955− ms <- match' s s'
1957+ ms <- match' s s'
1956− return (mt ++ ms)
1958+ return (mt ++ ms)
1957− match (PLam _ _ t s) (PLam _ _ t' s') = do mt <- match' t t'
1959+ match (PLam _ _ _ t s) (PLam _ _ _ t' s') = do mt <- match' t t'
1958− ms <- match' s s'
1960+ ms <- match' s s'
1959− return (mt ++ ms)
1961+ return (mt ++ ms)
1960 match (PLet _ _ t ty s) (PLet _ _ t' ty' s') = do mt <- match' t t'
1962 match (PLet _ _ t ty s) (PLet _ _ t' ty' s') = do mt <- match' t t'
1961 mty <- match' ty ty'
1963 mty <- match' ty ty'
1962 ms <- match' s s'
1964 ms <- match' s s'
@@ -2003,13 +2005,13 @@ substMatch n = substMatchShadow n []
2003substMatchShadow :: Name -> [Name] -> PTerm -> PTerm -> PTerm
2005substMatchShadow :: Name -> [Name] -> PTerm -> PTerm -> PTerm
2004substMatchShadow n shs tm t = sm shs t where
2006substMatchShadow n shs tm t = sm shs t where
2005 sm xs (PRef _ n') | n == n' = tm
2007 sm xs (PRef _ n') | n == n' = tm
2006− sm xs (PLam fc x t sc) = PLam fc x (sm xs t) (sm xs sc)
2008+ sm xs (PLam fc x xfc t sc) = PLam fc x xfc (sm xs t) (sm xs sc)
2007− sm xs (PPi p x t sc)
2009+ sm xs (PPi p x fc t sc)
2008 | x `elem` xs
2010 | x `elem` xs
2009 = let x' = nextName x in
2011 = let x' = nextName x in
2010− PPi p x' (sm (x':xs) (substMatch x (PRef emptyFC x') t))
2012+ PPi p x' fc (sm (x':xs) (substMatch x (PRef emptyFC x') t))
2011− (sm (x':xs) (substMatch x (PRef emptyFC x') sc))
2013+ (sm (x':xs) (substMatch x (PRef emptyFC x') sc))
2012− | otherwise = PPi p x (sm xs t) (sm (x : xs) sc)
2014+ | otherwise = PPi p x fc (sm xs t) (sm (x : xs) sc)
2013 sm xs (PApp f x as) = fullApp $ PApp f (sm xs x) (map (fmap (sm xs)) as)
2015 sm xs (PApp f x as) = fullApp $ PApp f (sm xs x) (map (fmap (sm xs)) as)
2014 sm xs (PCase f x as) = PCase f (sm xs x) (map (pmap (sm xs)) as)
2016 sm xs (PCase f x as) = PCase f (sm xs x) (map (pmap (sm xs)) as)
2015 sm xs (PIfThenElse fc c t f) = PIfThenElse fc (sm xs c) (sm xs t) (sm xs f)
2017 sm xs (PIfThenElse fc c t f) = PIfThenElse fc (sm xs c) (sm xs t) (sm xs f)
@@ -2032,10 +2034,10 @@ substMatchShadow n shs tm t = sm shs t where
2032shadow :: Name -> Name -> PTerm -> PTerm
2034shadow :: Name -> Name -> PTerm -> PTerm
2033shadow n n' t = sm t where
2035shadow n n' t = sm t where
2034 sm (PRef fc x) | n == x = PRef fc n'
2036 sm (PRef fc x) | n == x = PRef fc n'
2035− sm (PLam fc x t sc) | n /= x = PLam fc x (sm t) (sm sc)
2037+ sm (PLam fc x xfc t sc) | n /= x = PLam fc x xfc (sm t) (sm sc)
2036− | otherwise = PLam fc x (sm t) sc
2038+ | otherwise = PLam fc x xfc (sm t) sc
2037− sm (PPi p x t sc) | n /= x = PPi p x (sm t) (sm sc)
2039+ sm (PPi p x fc t sc) | n /= x = PPi p x fc (sm t) (sm sc)
2038− | otherwise = PPi p x (sm t) sc
2040+ | otherwise = PPi p x fc (sm t) sc
2039 sm (PLet fc x t v sc) | n /= x = PLet fc x (sm t) (sm v) (sm sc)
2041 sm (PLet fc x t v sc) | n /= x = PLet fc x (sm t) (sm v) (sm sc)
2040 | otherwise = PLet fc x (sm t) (sm v) sc
2042 | otherwise = PLet fc x (sm t) (sm v) sc
2041 sm (PApp f x as) = PApp f (sm x) (map (fmap sm) as)
2043 sm (PApp f x as) = PApp f (sm x) (map (fmap sm) as)
@@ -2077,7 +2079,7 @@ mkUniqueNames env tm = evalState (mkUniq tm) (S.fromList env) where
2077 mkUniqT tac = return tac
2079 mkUniqT tac = return tac
2079 mkUniq :: PTerm -> State (S.Set Name) PTerm
2081 mkUniq :: PTerm -> State (S.Set Name) PTerm
2080− mkUniq (PLam fc n ty sc)
2082+ mkUniq (PLam fc n nfc ty sc)
2081 = do env <- get
2083 = do env <- get
2082 (n', sc') <-
2084 (n', sc') <-
2083 if n `S.member` env
2085 if n `S.member` env
@@ -2088,8 +2090,8 @@ mkUniqueNames env tm = evalState (mkUniq tm) (S.fromList env) where
2088 put (S.insert n' env)
2090 put (S.insert n' env)
2089 ty' <- mkUniq ty
2091 ty' <- mkUniq ty
2090 sc'' <- mkUniq sc'
2092 sc'' <- mkUniq sc'
2091− return $! PLam fc n' ty' sc''
2093+ return $! PLam fc n' nfc ty' sc''
2092− mkUniq (PPi p n ty sc)
2094+ mkUniq (PPi p n fc ty sc)
2093 = do env <- get
2095 = do env <- get
2094 (n', sc') <-
2096 (n', sc') <-
2095 if n `S.member` env
2097 if n `S.member` env
@@ -2100,7 +2102,7 @@ mkUniqueNames env tm = evalState (mkUniq tm) (S.fromList env) where
2100 put (S.insert n' env)
2102 put (S.insert n' env)
2101 ty' <- mkUniq ty
2103 ty' <- mkUniq ty
2102 sc'' <- mkUniq sc'
2104 sc'' <- mkUniq sc'
2103− return $! PPi p n' ty' sc''
2105+ return $! PPi p n' fc ty' sc''
2104 mkUniq (PLet fc n ty val sc)
2106 mkUniq (PLet fc n ty val sc)
2105 = do env <- get
2107 = do env <- get
2106 (n', sc') <-
2108 (n', sc') <-