@@ -381,12 +381,25 @@ getNameHints i n =
383addDeprecated :: Name -> String -> Idris ()
383addDeprecated :: Name -> String -> Idris ()
384−addDeprecated n reason = do i <- getIState
384+addDeprecated n reason = do
385− putIState $ i { idris_deprecated = addDef n reason (idris_deprecated i) }
386+ putIState $ i { idris_deprecated = addDef n reason (idris_deprecated i) }
387getDeprecated :: Name -> Idris (Maybe String)
388getDeprecated :: Name -> Idris (Maybe String)
388−getDeprecated n = do i <- getIState
389+getDeprecated n = do
389− return $ lookupCtxtExact n (idris_deprecated i)
391+ return $ lookupCtxtExact n (idris_deprecated i)
394+addFragile :: Name -> String -> Idris ()
395+addFragile n reason = do
397+ putIState $ i { idris_fragile = addDef n reason (idris_fragile i) }
399+getFragile :: Name -> Idris (Maybe String)
402+ return $ lookupCtxtExact n (idris_fragile i)
391push_estack :: Name -> Bool -> Idris ()
404push_estack :: Name -> Bool -> Idris ()
392push_estack n inst
405push_estack n inst
@@ -658,7 +671,7 @@ addDeferred' nt ns
658 = do mapM_ (\(n, (i, _, t, _, _, _)) -> updateContext (addTyDecl n nt (tidyNames S.empty t))) ns
671 = do mapM_ (\(n, (i, _, t, _, _, _)) -> updateContext (addTyDecl n nt (tidyNames S.empty t))) ns
659 mapM_ (\(n, _) -> when (not (n `elem` primDefs)) $ addIBC (IBCMetavar n)) ns
672 mapM_ (\(n, _) -> when (not (n `elem` primDefs)) $ addIBC (IBCMetavar n)) ns
660 i <- getIState
673 i <- getIState
661− putIState $ i { idris_metavars = map (\(n, (i, top, _, ns, isTopLevel, isDefinable)) ->
674+ putIState $ i { idris_metavars = map (\(n, (i, top, _, ns, isTopLevel, isDefinable)) ->
662 (n, (top, i, ns, isTopLevel, isDefinable))) ns ++
675 (n, (top, i, ns, isTopLevel, isDefinable))) ns ++
663 idris_metavars i }
676 idris_metavars i }
@@ -673,7 +686,7 @@ addDeferred' nt ns
673 tidyNames used b = b
686 tidyNames used b = b
675solveDeferred :: FC -> Name -> Idris ()
688solveDeferred :: FC -> Name -> Idris ()
676−solveDeferred fc n
689+solveDeferred fc n
677 = do i <- getIState
690 = do i <- getIState
678 case lookup n (idris_metavars i) of
691 case lookup n (idris_metavars i) of
679 Just (_, _, _, _, False) ->
692 Just (_, _, _, _, False) ->
@@ -1701,7 +1714,7 @@ addImpl' inpat env infns imp_meths ist ptm
1701 ai :: Bool -> Bool -> [(Name, Maybe PTerm)] -> [[T.Text]] -> PTerm -> PTerm
1714 ai :: Bool -> Bool -> [(Name, Maybe PTerm)] -> [[T.Text]] -> PTerm -> PTerm
1702 ai inpat qq env ds (PRef fc fcs f)
1715 ai inpat qq env ds (PRef fc fcs f)
1703 | f `elem` infns = PInferRef fc fcs f
1716 | f `elem` infns = PInferRef fc fcs f
1704− | not (f `elem` map fst env) = handleErr $ aiFn topname inpat inpat qq imp_meths ist fc f fc ds []
1717+ | not (f `elem` map fst env) = handleErr $ aiFn topname inpat inpat qq imp_meths ist fc f fc ds []
1705 ai inpat qq env ds (PHidden (PRef fc hl f))
1718 ai inpat qq env ds (PHidden (PRef fc hl f))
1706 | not (f `elem` map fst env) = PHidden (handleErr $ aiFn topname inpat False qq imp_meths ist fc f fc ds [])
1719 | not (f `elem` map fst env) = PHidden (handleErr $ aiFn topname inpat False qq imp_meths ist fc f fc ds [])
1707 ai inpat qq env ds (PRewrite fc by l r g)
1720 ai inpat qq env ds (PRewrite fc by l r g)
@@ -1742,7 +1755,7 @@ addImpl' inpat env infns imp_meths ist ptm
1742 = let f' = ai inpat qq env ds f
1755 = let f' = ai inpat qq env ds f
1743 as' = map (fmap (ai inpat qq env ds)) as in
1756 as' = map (fmap (ai inpat qq env ds)) as in
1744 mkPApp fc 1 f' as'
1757 mkPApp fc 1 f' as'
1745− ai inpat qq env ds (PWithApp fc f a)
1758+ ai inpat qq env ds (PWithApp fc f a)
1746 = PWithApp fc (ai inpat qq env ds f) (ai inpat qq env ds a)
1759 = PWithApp fc (ai inpat qq env ds f) (ai inpat qq env ds a)
1747 ai inpat qq env ds (PCase fc c os)
1760 ai inpat qq env ds (PCase fc c os)
1748 = let c' = ai inpat qq env ds c in
1761 = let c' = ai inpat qq env ds c in
@@ -1750,7 +1763,7 @@ addImpl' inpat env infns imp_meths ist ptm
1750 -- definition which is passed through addImpl again
1763 -- definition which is passed through addImpl again
1751 PCase fc c' (map aiCase os)
1764 PCase fc c' (map aiCase os)
1753− aiCase (lhs, rhs)
1766+ aiCase (lhs, rhs)
1754 = (lhs, ai inpat qq (env ++ patnames lhs) ds rhs)
1767 = (lhs, ai inpat qq (env ++ patnames lhs) ds rhs)
1756 -- Anything beginning with a lower case letter, not applied,
1769 -- Anything beginning with a lower case letter, not applied,
@@ -1854,9 +1867,9 @@ aiFn topname inpat True qq imp_meths ist fc f ffc ds []
1854 vname (UN n) = True -- non qualified
1867 vname (UN n) = True -- non qualified
1855 vname _ = False
1868 vname _ = False
1857−aiFn topname inpat expat qq imp_meths ist fc f ffc ds as
1870+aiFn topname inpat expat qq imp_meths ist fc f ffc ds as
1858 | f `elem` primNames = Right $ PApp fc (PRef ffc [ffc] f) as
1871 | f `elem` primNames = Right $ PApp fc (PRef ffc [ffc] f) as
1859−aiFn topname inpat expat qq imp_meths ist fc f ffc ds as
1872+aiFn topname inpat expat qq imp_meths ist fc f ffc ds as
1860 -- This is where namespaces get resolved by adding PAlternative
1873 -- This is where namespaces get resolved by adding PAlternative
1861 = do let ns = lookupCtxtName f (idris_implicits ist)
1874 = do let ns = lookupCtxtName f (idris_implicits ist)
1862 let nh = filter (\(n, _) -> notHidden n) ns
1875 let nh = filter (\(n, _) -> notHidden n) ns
@@ -1920,7 +1933,7 @@ aiFn topname inpat expat qq imp_meths ist fc f ffc ds as
1920 case find n imps [] of
1933 case find n imps [] of
1921 Just (tm, imps') ->
1934 Just (tm, imps') ->
1922 PImp p False l n tm : insImpAcc (M.insert n tm pnas) ps given imps'
1935 PImp p False l n tm : insImpAcc (M.insert n tm pnas) ps given imps'
1923− Nothing ->
1936+ Nothing ->
1924 PImp p True l n Placeholder :
1937 PImp p True l n Placeholder :
1925 insImpAcc (M.insert n Placeholder pnas) ps given imps
1938 insImpAcc (M.insert n Placeholder pnas) ps given imps
1926 insImpAcc pnas (PTacImplicit p l n sc' ty : ps) given imps =
1939 insImpAcc pnas (PTacImplicit p l n sc' ty : ps) given imps =