@@ -526,13 +526,13 @@ elabEliminator paramPos n ty cons info = do
526 findRecArgs (ty:rs) = findRecArgs rs
526 findRecArgs (ty:rs) = findRecArgs rs
528 applyCons :: Name -> [(Name, Plicity, PTerm)] -> PTerm
528 applyCons :: Name -> [(Name, Plicity, PTerm)] -> PTerm
529− applyCons tn targs = PApp elimFC (PRef elimFC tn) (map convertArg targs) -- ipapp
529+ applyCons tn targs = PApp elimFC (PRef elimFC tn) (map convertArg targs)
531 convertArg :: (Name, Plicity, PTerm) -> PArg
531 convertArg :: (Name, Plicity, PTerm) -> PArg
532 convertArg (n, _, _) = pexp (PRef elimFC n)
532 convertArg (n, _, _) = pexp (PRef elimFC n)
534 applyMotive :: [PTerm] -> PTerm -> PTerm
534 applyMotive :: [PTerm] -> PTerm -> PTerm
535− applyMotive idxs t = PApp elimFC (PRef elimFC motiveName) (map pexp idxs ++ [pexp t]) -- ipapp
535+ applyMotive idxs t = PApp elimFC (PRef elimFC motiveName) (map pexp idxs ++ [pexp t])
537 getPiName :: (Name, Plicity, PTerm) -> Name
537 getPiName :: (Name, Plicity, PTerm) -> Name
538 getPiName (name,_,_) = name
538 getPiName (name,_,_) = name
@@ -550,13 +550,13 @@ elabEliminator paramPos n ty cons info = do
550 let (_, generalIdxs') = splitArgPms resTy
550 let (_, generalIdxs') = splitArgPms resTy
551 let generalIdxs = map pexp generalIdxs'
551 let generalIdxs = map pexp generalIdxs'
552 consArgs <- namePis True args
552 consArgs <- namePis True args
553− let lhsPattern = PApp elimFC (PRef elimFC elimDeclName) (generalArgs ++ generalIdxs ++ [pexp $ applyCons cnm consArgs]) -- ipapp
553+ let lhsPattern = PApp elimFC (PRef elimFC elimDeclName) (generalArgs ++ generalIdxs ++ [pexp $ applyCons cnm consArgs])
554 let recArgs = findRecArgs consArgs
554 let recArgs = findRecArgs consArgs
555 let recElims = map applyRecElim recArgs
555 let recElims = map applyRecElim recArgs
556− let rhsExpr = PApp elimFC (PRef elimFC cnsElim) (map convertArg implidxs ++ map convertArg consArgs ++ recElims) -- ipapp
556+ let rhsExpr = PApp elimFC (PRef elimFC cnsElim) (map convertArg implidxs ++ map convertArg consArgs ++ recElims)
557 return $ PClause elimFC elimDeclName lhsPattern [] rhsExpr []
557 return $ PClause elimFC elimDeclName lhsPattern [] rhsExpr []
558 where applyRecElim :: (Name, Plicity, PTerm) -> PArg
558 where applyRecElim :: (Name, Plicity, PTerm) -> PArg
559− applyRecElim (constr@(recCnm,_,recTy)) = pexp $ PApp elimFC (PRef elimFC elimDeclName) (generalArgs ++ map pexp idxs ++ [pexp $ PRef elimFC recCnm]) -- ipapp
559+ applyRecElim (constr@(recCnm,_,recTy)) = pexp $ PApp elimFC (PRef elimFC elimDeclName) (generalArgs ++ map pexp idxs ++ [pexp $ PRef elimFC recCnm])
560 where (_, idxs) = splitArgPms recTy
560 where (_, idxs) = splitArgPms recTy
562-- | Elaborate primitives
562-- | Elaborate primitives
@@ -668,7 +668,7 @@ elabProvider info syn fc what n ty tm
668 | what `elem` [ProvTerm, ProvAny] ->
668 | what `elem` [ProvTerm, ProvAny] ->
669 do -- Finally add a top-level definition of the provided term
669 do -- Finally add a top-level definition of the provided term
670 elabType info syn emptyDocstring [] fc [] n ty
670 elabType info syn emptyDocstring [] fc [] n ty
671− elabClauses info fc [] n [PClause fc n (PApp fc (PRef fc n) []) [] (delab i tm) []] -- ipapp
671+ elabClauses info fc [] n [PClause fc n (PApp fc (PRef fc n) []) [] (delab i tm) []]
672 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
672 logLvl 3 $ "Elaborated provider " ++ show n ++ " as: " ++ show tm
673 | otherwise ->
673 | otherwise ->
674 ierror . Msg $ "Attempted to provide a term where a postulate was expected."
674 ierror . Msg $ "Attempted to provide a term where a postulate was expected."
@@ -741,7 +741,7 @@ elabRecord info syn doc fc tyn ty cdoc cn cty
741 let ptys_u = getProjs [] cty
741 let ptys_u = getProjs [] cty
742 let recty = getRecTy cty
742 let recty = getRecTy cty
743 logLvl 6 $ show (recty, ptys)
743 logLvl 6 $ show (recty, ptys)
744− let substs = map (\ (n, _) -> (n, PApp fc (PRef fc n) -- ipapp
744+ let substs = map (\ (n, _) -> (n, PApp fc (PRef fc n)
745 [pexp (PRef fc rec)])) ptys
745 [pexp (PRef fc rec)])) ptys
746 proj_decls <- mapM (mkProj recty substs cimp) (zip ptys [0..])
746 proj_decls <- mapM (mkProj recty substs cimp) (zip ptys [0..])
747 let nonImp = mapMaybe isNonImp (zip cimp ptys_u)
747 let nonImp = mapMaybe isNonImp (zip cimp ptys_u)
@@ -807,8 +807,8 @@ elabRecord info syn doc fc tyn ty cdoc cn cty
807 let after = length substs - (pos + 1)
807 let after = length substs - (pos + 1)
808 let args = take before pls ++ PRef fc (mkp pn) : take after pls
808 let args = take before pls ++ PRef fc (mkp pn) : take after pls
809 let iargs = map implicitise (zip cimp args)
809 let iargs = map implicitise (zip cimp args)
810− let lhs = PApp fc (PRef fc pn) -- ipapp
810+ let lhs = PApp fc (PRef fc pn)
811− [pexp (PApp fc (PRef fc cn) iargs)] -- ipapp
811+ [pexp (PApp fc (PRef fc cn) iargs)]
812 let rhs = PRef fc (mkp pn)
812 let rhs = PRef fc (mkp pn)
813 let pclause = PClause fc pn lhs [] rhs []
813 let pclause = PClause fc pn lhs [] rhs []
814 return [pfnTy, PClauses fc [] pn [pclause]]
814 return [pfnTy, PClauses fc [] pn [pclause]]
@@ -826,12 +826,12 @@ elabRecord info syn doc fc tyn ty cdoc cn cty
826 let rhsArgs = take pos pls ++ (PRef fc valname) :
826 let rhsArgs = take pos pls ++ (PRef fc valname) :
827 drop (pos + 1) pls
827 drop (pos + 1) pls
828 let before = pos
828 let before = pos
829− let pclause = PClause fc setname (PApp fc (PRef fc setname) -- ipapp
829+ let pclause = PClause fc setname (PApp fc (PRef fc setname)
830 [pexp (PRef fc valname),
830 [pexp (PRef fc valname),
831− pexp (PApp fc (PRef fc cn) -- ipapp
831+ pexp (PApp fc (PRef fc cn)
832 (map pexp lhsArgs))])
832 (map pexp lhsArgs))])
834− (PApp fc (PRef fc cn) -- ipapp
834+ (PApp fc (PRef fc cn)
835 (map pexp rhsArgs)) []
835 (map pexp rhsArgs)) []
836 return (pn, pfnTy, PClauses fc [] setname [pclause])
836 return (pn, pfnTy, PClauses fc [] setname [pclause])
@@ -876,7 +876,7 @@ elabCon info syn tn codata (doc, argDocs, n, t_in, fc, forcenames)
877 mkLazy (PPi pl n ty sc)
877 mkLazy (PPi pl n ty sc)
878 = let ty' = if getTyName ty
878 = let ty' = if getTyName ty
879− then PApp fc (PRef fc (sUN "Lazy'")) -- ipapp
879+ then PApp fc (PRef fc (sUN "Lazy'"))
880 [pexp (PRef fc (sUN "LazyCodata")),
880 [pexp (PRef fc (sUN "LazyCodata")),
882 else ty in
882 else ty in
@@ -1341,7 +1341,7 @@ paramNames args env (p : ps)
1342propagateParams :: [Name] -> Type -> PTerm -> PTerm
1342propagateParams :: [Name] -> Type -> PTerm -> PTerm
1343propagateParams ps t tm@(PApp _ (PRef fc n) args)
1343propagateParams ps t tm@(PApp _ (PRef fc n) args)
1344− = PApp fc (PRef fc n) (addP t args) -- tpapp
1344+ = PApp fc (PRef fc n) (addP t args)
1345 where addP (Bind n _ sc) (t : ts)
1345 where addP (Bind n _ sc) (t : ts)
1346 | Placeholder <- getTm t,
1346 | Placeholder <- getTm t,
1347 n `elem` ps,
1347 n `elem` ps,
@@ -1350,7 +1350,7 @@ propagateParams ps t tm@(PApp _ (PRef fc n) args)
1350 addP (Bind n _ sc) (t : ts) = t : addP sc ts
1350 addP (Bind n _ sc) (t : ts) = t : addP sc ts
1351 addP _ ts = ts
1351 addP _ ts = ts
1352propagateParams ps t (PRef fc n)
1352propagateParams ps t (PRef fc n)
1353− = PApp fc (PRef fc n) (map (\x -> pimp x (PRef fc x) True) ps) -- ipapp
1353+ = PApp fc (PRef fc n) (map (\x -> pimp x (PRef fc x) True) ps)
1354propagateParams ps t x = x
1354propagateParams ps t x = x
1356elabClause :: ElabInfo -> FnOpts -> (Int, PClause) ->
1356elabClause :: ElabInfo -> FnOpts -> (Int, PClause) ->
@@ -1509,7 +1509,7 @@ elabClause info opts (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
1509 addErrRev (crhs, clhs)
1509 addErrRev (crhs, clhs)
1510 return $ Right (clhs, crhs)
1510 return $ Right (clhs, crhs)
1512− mkLHSapp t@(PRef _ _) = trace ("APP " ++ show t) $ PApp fc t [] -- ipapp
1512+ mkLHSapp t@(PRef _ _) = trace ("APP " ++ show t) $ PApp fc t []
1513 mkLHSapp t = t
1513 mkLHSapp t = t
1515 decorate (NS x ns)
1515 decorate (NS x ns)
@@ -1640,7 +1640,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1640 mapM_ (elabDecl EAll info) wb
1640 mapM_ (elabDecl EAll info) wb
1642 -- rhs becomes: fname' ps wval
1642 -- rhs becomes: fname' ps wval
1643− let rhs = PApp fc (PRef fc wname) -- ipapp
1643+ let rhs = PApp fc (PRef fc wname)
1644 (map (pexp . (PRef fc) . fst) bargs_pre ++
1644 (map (pexp . (PRef fc) . fst) bargs_pre ++
1645 pexp wval :
1645 pexp wval :
1646 (map (pexp . (PRef fc) . fst) bargs_post))
1646 (map (pexp . (PRef fc) . fst) bargs_post))
@@ -1697,14 +1697,14 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1697 mkAux wname toplhs ns ns' c
1697 mkAux wname toplhs ns ns' c
1698 = ifail $ show fc ++ "badly formed with clause"
1698 = ifail $ show fc ++ "badly formed with clause"
1700− addArg (PApp fc f args) w = PApp fc f (args ++ [pexp w]) -- tpapp
1700+ addArg (PApp fc f args) w = PApp fc f (args ++ [pexp w])
1701− addArg (PRef fc f) w = PApp fc (PRef fc f) [pexp w] -- ipapp
1701+ addArg (PRef fc f) w = PApp fc (PRef fc f) [pexp w]
1703 updateLHS n wname mvars ns_in ns_in' (PApp fc (PRef fc' n') args) w
1703 updateLHS n wname mvars ns_in ns_in' (PApp fc (PRef fc' n') args) w
1704 = let ns = map (keepMvar (map fst mvars) fc') ns_in
1704 = let ns = map (keepMvar (map fst mvars) fc') ns_in
1705 ns' = map (keepMvar (map fst mvars) fc') ns_in' in
1705 ns' = map (keepMvar (map fst mvars) fc') ns_in' in
1706 return $ substMatches mvars $
1706 return $ substMatches mvars $
1707− PApp fc (PRef fc' wname) -- tpapp
1707+ PApp fc (PRef fc' wname)
1708 (map pexp ns ++ pexp w : (map pexp ns'))
1708 (map pexp ns ++ pexp w : (map pexp ns'))
1709 updateLHS n wname mvars ns ns' tm w
1709 updateLHS n wname mvars ns ns' tm w
1710 = ifail $ "Not implemented match " ++ show tm
1710 = ifail $ "Not implemented match " ++ show tm
@@ -1712,7 +1712,7 @@ elabClause info opts (_, PWith fc fname lhs_in withs wval_in withblock)
1712 keepMvar mvs fc v | v `elem` mvs = PRef fc v
1712 keepMvar mvs fc v | v `elem` mvs = PRef fc v
1713 | otherwise = Placeholder
1713 | otherwise = Placeholder
1715− fullApp (PApp _ (PApp fc f args) xs) = fullApp (PApp fc f (args ++ xs)) -- tpapp
1715+ fullApp (PApp _ (PApp fc f args) xs) = fullApp (PApp fc f (args ++ xs))
1716 fullApp x = x
1716 fullApp x = x
1718 split [] rest pre = (reverse pre, rest)
1718 split [] rest pre = (reverse pre, rest)
@@ -1731,7 +1731,7 @@ elabClass :: ElabInfo -> SyntaxInfo -> Docstring ->
1731elabClass info syn doc fc constraints tn ps ds
1731elabClass info syn doc fc constraints tn ps ds
1732 = do let cn = SN (InstanceCtorN tn) -- sUN ("instance" ++ show tn) -- MN 0 ("instance" ++ show tn)
1732 = do let cn = SN (InstanceCtorN tn) -- sUN ("instance" ++ show tn) -- MN 0 ("instance" ++ show tn)
1733 let tty = pibind ps PType
1733 let tty = pibind ps PType
1734− let constraint = PApp fc (PRef fc tn) -- ipapp
1734+ let constraint = PApp fc (PRef fc tn)
1735 (map (pexp . PRef fc) (map fst ps))
1735 (map (pexp . PRef fc) (map fst ps))
1736 -- build data declaration
1736 -- build data declaration
1737 let mdecls = filter tydecl ds -- method declarations
1737 let mdecls = filter tydecl ds -- method declarations
@@ -1782,7 +1782,7 @@ elabClass info syn doc fc constraints tn ps ds
1782 = do when (not $ null cs) . tclift
1782 = do when (not $ null cs) . tclift
1783 $ tfail (At fc (Msg $ "Default superclass instances can't have constraints."))
1783 $ tfail (At fc (Msg $ "Default superclass instances can't have constraints."))
1784 i <- getIState
1784 i <- getIState
1785− let t = PApp fc (PRef fc n) (map pexp ps) -- ipapp
1785+ let t = PApp fc (PRef fc n) (map pexp ps)
1786 let isConstrained = any (== t) constraints
1786 let isConstrained = any (== t) constraints
1787 when (not isConstrained) . tclift
1787 when (not isConstrained) . tclift
1788 $ tfail (At fc (Msg $ "Default instances must be for a superclass constraint on the containing class."))
1788 $ tfail (At fc (Msg $ "Default instances must be for a superclass constraint on the containing class."))
@@ -1829,8 +1829,8 @@ elabClass info syn doc fc constraints tn ps ds
1829 = do let cfn = sUN ('@':'@':show cn ++ "#" ++ show con)
1829 = do let cfn = sUN ('@':'@':show cn ++ "#" ++ show con)
1830 -- SN (ParentN cn (show con))
1830 -- SN (ParentN cn (show con))
1831 let mnames = take (length all) $ map (\x -> sMN x "meth") [0..]
1831 let mnames = take (length all) $ map (\x -> sMN x "meth") [0..]
1832− let capp = PApp fc (PRef fc cn) (map (pexp . PRef fc) mnames) -- ipapp
1832+ let capp = PApp fc (PRef fc cn) (map (pexp . PRef fc) mnames)
1833− let lhs = PApp fc (PRef fc cfn) [pconst capp] -- ipapp
1833+ let lhs = PApp fc (PRef fc cfn) [pconst capp]
1834 let rhs = PResolveTC (fileFC "HACK")
1834 let rhs = PResolveTC (fileFC "HACK")
1835 let ty = PPi constraint (sMN 0 "pc") c con
1835 let ty = PPi constraint (sMN 0 "pc") c con
1836 iLOG (showTmImpls ty)
1836 iLOG (showTmImpls ty)
@@ -1853,11 +1853,11 @@ elabClass info syn doc fc constraints tn ps ds
1853 tfun cn c syn all (m, (doc, o, ty))
1853 tfun cn c syn all (m, (doc, o, ty))
1854 = do let ty' = insertConstraint c ty
1854 = do let ty' = insertConstraint c ty
1855 let mnames = take (length all) $ map (\x -> sMN x "meth") [0..]
1855 let mnames = take (length all) $ map (\x -> sMN x "meth") [0..]
1856− let capp = PApp fc (PRef fc cn) (map (pexp . PRef fc) mnames) -- ipapp
1856+ let capp = PApp fc (PRef fc cn) (map (pexp . PRef fc) mnames)
1857 let margs = getMArgs ty
1857 let margs = getMArgs ty
1858 let anames = map (\x -> sMN x "arg") [0..]
1858 let anames = map (\x -> sMN x "arg") [0..]
1859− let lhs = PApp fc (PRef fc m) (pconst capp : lhsArgs margs anames) -- ipapp
1859+ let lhs = PApp fc (PRef fc m) (pconst capp : lhsArgs margs anames)
1860− let rhs = PApp fc (getMeth mnames all m) (rhsArgs margs anames) -- ipapp
1860+ let rhs = PApp fc (getMeth mnames all m) (rhsArgs margs anames)
1861 iLOG (showTmImpls ty)
1861 iLOG (showTmImpls ty)
1862 iLOG (show (m, ty', capp, margs))
1862 iLOG (show (m, ty', capp, margs))
1863 iLOG (showTmImpls lhs ++ " = " ++ showTmImpls rhs)
1863 iLOG (showTmImpls lhs ++ " = " ++ showTmImpls rhs)
@@ -1906,7 +1906,7 @@ elabInstance info syn what fc cs n ps t expn ds = do
1906 (n, ci) <- case lookupCtxtName n (idris_classes i) of
1906 (n, ci) <- case lookupCtxtName n (idris_classes i) of
1907 [c] -> return c
1907 [c] -> return c
1908 _ -> ifail $ show fc ++ ":" ++ show n ++ " is not a type class"
1908 _ -> ifail $ show fc ++ ":" ++ show n ++ " is not a type class"
1909− let constraint = PApp fc (PRef fc n) (map pexp ps) -- ipapp
1909+ let constraint = PApp fc (PRef fc n) (map pexp ps)
1910 let iname = mkiname n ps expn
1910 let iname = mkiname n ps expn
1911 when (what /= EDefns) $ do
1911 when (what /= EDefns) $ do
1912 nty <- elabType' True info syn emptyDocstring [] fc [] iname t
1912 nty <- elabType' True info syn emptyDocstring [] fc [] iname t
@@ -1961,9 +1961,9 @@ elabInstance info syn what fc cs n ps t expn ds = do
1961 _ -> Nothing
1961 _ -> Nothing
1962 _ -> Nothing) ps
1962 _ -> Nothing) ps
1963-- let lhs = PRef fc iname
1963-- let lhs = PRef fc iname
1964− let lhs = PApp fc (PRef fc iname) -- ipapp
1964+ let lhs = PApp fc (PRef fc iname)
1965 (map (\n -> pimp n (PRef fc n) True) headVars)
1965 (map (\n -> pimp n (PRef fc n) True) headVars)
1966− let rhs = PApp fc (PRef fc (instanceName ci)) -- ipapp
1966+ let rhs = PApp fc (PRef fc (instanceName ci))
1967 (map (pexp . mkMethApp) mtys)
1967 (map (pexp . mkMethApp) mtys)
1969 logLvl 5 $ "Instance LHS " ++ show lhs
1969 logLvl 5 $ "Instance LHS " ++ show lhs
@@ -2044,7 +2044,7 @@ elabInstance info syn what fc cs n ps t expn ds = do
2044 methArgs i _ = []
2044 methArgs i _ = []
2046 papp fc f [] = f
2046 papp fc f [] = f
2047− papp fc f as = PApp fc f as -- ipapp
2047+ papp fc f as = PApp fc f as
2049 getWParams [] = return []
2049 getWParams [] = return []
2050 getWParams (p : ps)
2050 getWParams (p : ps)
@@ -2129,7 +2129,7 @@ decorateid decorate (PClauses f o n cs)
2129 dc (PWith fc n t as w ds)
2129 dc (PWith fc n t as w ds)
2130 = PWith fc (decorate n) (dappname t) as w
2130 = PWith fc (decorate n) (dappname t) as w
2131 (map (decorateid decorate) ds)
2131 (map (decorateid decorate) ds)
2132− dappname (PApp fc (PRef fc' n) as) = PApp fc (PRef fc' (decorate n)) as -- tpapp
2132+ dappname (PApp fc (PRef fc' n) as) = PApp fc (PRef fc' (decorate n)) as
2133 dappname t = t
2133 dappname t = t