@@ -57,7 +57,7 @@ data ElabInfo = EInfo { params :: [(Name, PTerm)],
5757 liftname :: Name -> Name,
5858 namespace :: Maybe [String],
5959 elabFC :: Maybe FC,
60− rec_elabDecl :: ElabWhat -> ElabInfo -> PDecl ->
60+ rec_elabDecl :: ElabWhat -> ElabInfo -> PDecl ->
6161 Idris () }
6262
6363toplevel :: ElabInfo
@@ -601,14 +601,19 @@ data PDecl' t
601601 [PDecl' t] -- declarations
602602 -- ^ Type class: arguments are documentation, syntax info, source location, constraints,
603603 -- class name, parameters, method declarations
604− | PInstance SyntaxInfo FC [(Name, t)] -- constraints
605− Name -- class
606− [t] -- parameters
607− t -- full instance type
608− (Maybe Name) -- explicit name
609− [PDecl' t]
610− -- ^ Instance declaration: arguments are syntax info, source location, constraints,
611− -- class name, parameters, full instance type, optional explicit name, and definitions
604+ | PInstance
605+ (Docstring (Either Err PTerm)) -- Instance docs
606+ [(Name, Docstring (Either Err PTerm))] -- Parameter docs
607+ SyntaxInfo
608+ FC [(Name, t)] -- constraints
609+ Name -- class
610+ [t] -- parameters
611+ t -- full instance type
612+ (Maybe Name) -- explicit name
613+ [PDecl' t]
614+ -- ^ Instance declaration: arguments are documentation, syntax info, source
615+ -- location, constraints, class name, parameters, full instance
616+ -- type, optional explicit name, and definitions
612617 | PDSL Name (DSL' t) -- ^ DSL declaration
613618 | PSyntax FC Syntax -- ^ Syntax definition
614619 | PMutual FC [PDecl' t] -- ^ Mutual block
@@ -688,7 +693,7 @@ declared (PParams _ _ ds) = concatMap declared ds
688693declared (PNamespace _ ds) = concatMap declared ds
689694declared (PRecord _ _ _ n _ _ _ c _) = [n, c]
690695declared (PClass _ _ _ _ n _ _ ms) = n : concatMap declared ms
691−declared (PInstance _ _ _ _ _ _ _ _) = []
696+declared (PInstance _ _ _ _ _ _ _ _ _ _) = []
692697declared (PDSL n _) = [n]
693698declared (PSyntax _ _) = []
694699declared (PMutual _ ds) = concatMap declared ds
@@ -707,7 +712,7 @@ tldeclared (PParams _ _ ds) = []
707712tldeclared (PMutual _ ds) = concatMap tldeclared ds
708713tldeclared (PNamespace _ ds) = concatMap tldeclared ds
709714tldeclared (PClass _ _ _ _ n _ _ ms) = concatMap tldeclared ms
710−tldeclared (PInstance _ _ _ _ _ _ _ _) = []
715+tldeclared (PInstance _ _ _ _ _ _ _ _ _ _) = []
711716tldeclared _ = []
712717
713718defined :: PDecl -> [Name]
@@ -723,7 +728,7 @@ defined (PParams _ _ ds) = concatMap defined ds
723728defined (PNamespace _ ds) = concatMap defined ds
724729defined (PRecord _ _ _ n _ _ _ c _) = [n, c]
725730defined (PClass _ _ _ _ n _ _ ms) = n : concatMap defined ms
726−defined (PInstance _ _ _ _ _ _ _ _) = []
731+defined (PInstance _ _ _ _ _ _ _ _ _ _) = []
727732defined (PDSL n _) = [n]
728733defined (PSyntax _ _) = []
729734defined (PMutual _ ds) = concatMap defined ds
@@ -778,7 +783,7 @@ data PTerm = PQuote Raw -- ^ Inclusion of a core term into the high-level langua
778783 | PAlternative Bool [PTerm] -- ^ True if only one may work. (| A, B, C|)
779784 | PHidden PTerm -- ^ Irrelevant or hidden pattern
780785 | PType -- ^ 'Type' type
781− | PUniverse Universe -- ^ Some universe
786+ | PUniverse Universe -- ^ Some universe
782787 | PGoal FC PTerm Name PTerm -- ^ quoteGoal, used for %reflection functions
783788 | PConstant Const -- ^ Builtin types
784789 | Placeholder -- ^ Underscore
@@ -1113,7 +1118,7 @@ data SSymbol = Keyword Name
11131118 | Expr Name
11141119 | SimpleExpr Name
11151120 deriving (Show, Eq)
1116−
1121+
11171122
11181123{-!
11191124deriving instance Binary SSymbol
@@ -1388,7 +1393,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
13881393 where
13891394 startPrec = 0
13901395 funcAppPrec = 10
1391−
1396+
13921397 prettySe :: Int -> [(Name, Bool)] -> PTerm -> Doc OutputAnnotation
13931398 prettySe p bnd (PQuote r) =
13941399 text "![" <> pretty r <> text "]"
@@ -1451,7 +1456,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
14511456 [x] -> group (opName True <$> group (prettySe startPrec bnd (getTm x)))
14521457 [l,r] -> let precedence = maybe (startPrec - 1) prec f
14531458 in bracket p precedence $ inFix (getTm l) (getTm r)
1454− (l@(PExp _ _ _ _) : r@(PExp _ _ _ _) : rest) ->
1459+ (l@(PExp _ _ _ _) : r@(PExp _ _ _ _) : rest) ->
14551460 bracket p funcAppPrec $
14561461 enclose lparen rparen (inFix (getTm l) (getTm r)) <+>
14571462 align (group (vsep (map (prettyArgS bnd) rest)))
@@ -1467,7 +1472,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
14671472 Just (Infixr p') -> p'
14681473 Just f' -> prec f' + 1
14691474 inFix l r = align . group $
1470− (prettySe left bnd l <+> opName False) <$>
1475+ (prettySe left bnd l <+> opName False) <$>
14711476 group (prettySe right bnd r)
14721477 prettySe p bnd (PApp _ hd@(PRef fc f) [tm]) -- symbols, like 'foo
14731478 | PConstant (Idris.Core.TT.Str str) <- getTm tm,
@@ -1486,7 +1491,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
14861491 align $ kwd "case" <+> prettySe startPrec bnd scr <+> kwd "of" <$>
14871492 indent 2 (vsep (map ppcase cases))
14881493 where
1489− ppcase (l, r) = let prettyCase = prettySe startPrec
1494+ ppcase (l, r) = let prettyCase = prettySe startPrec
14901495 ([(n, False) | n <- vars l] ++ bnd)
14911496 in nest nestingSize $
14921497 prettyCase l <+> text "=>" <+> prettyCase r
@@ -1557,7 +1562,7 @@ pprintPTerm ppo bnd docArgs infixes = prettySe startPrec bnd
15571562 prettyAs =
15581563 foldr (\l -> \r -> l <+> text "," <+> r) empty $ map (prettySe startPrec bnd) as
15591564 prettySe p bnd PType = annotate (AnnType "Type" "The type of types") $ text "Type"
1560− prettySe p bnd (PUniverse u) = annotate (AnnType (show u) "The type of unique types") $ text (show u)
1565+ prettySe p bnd (PUniverse u) = annotate (AnnType (show u) "The type of unique types") $ text (show u)
15611566 prettySe p bnd (PConstant c) = annotate (AnnConst c) (text (show c))
15621567 -- XXX: add pretty for tactics
15631568 prettySe p bnd (PProof ts) =
@@ -1729,7 +1734,7 @@ showDeclImp o (PNamespace n ps) = text "namespace" <+> text n <> braces (line <>
17291734showDeclImp _ (PSyntax _ syn) = text "syntax" <+> text (show syn)
17301735showDeclImp o (PClass _ _ _ cs n ps _ ds)
17311736 = text "class" <+> text (show cs) <+> text (show n) <+> text (show ps) <> line <> showDecls o ds
1732−showDeclImp o (PInstance _ _ cs n _ t _ ds)
1737+showDeclImp o (PInstance _ _ _ _ cs n _ t _ ds)
17331738 = text "instance" <+> text (show cs) <+> text (show n) <+> prettyImp o t <> line <> showDecls o ds
17341739showDeclImp _ _ = text "..."
17351740-- showDeclImp (PImport o) = "import " ++ o
@@ -1905,16 +1910,16 @@ implicitNamesIn :: [Name] -> IState -> PTerm -> [Name]
19051910implicitNamesIn uvars ist tm = nub $ ni [] tm
19061911 where
19071912 ni env (PRef _ n)
1908− | not (n `elem` env)
1913+ | not (n `elem` env)
19091914 = case lookupTy n (tt_ctxt ist) of
19101915 [] -> [n]
19111916 _ -> if n `elem` uvars then [n] else []
1912− ni env (PApp _ f@(PRef _ n) as)
1917+ ni env (PApp _ f@(PRef _ n) as)
19131918 | n `elem` uvars = ni env f ++ concatMap (ni env) (map getTm as)
19141919 | otherwise = concatMap (ni env) (map getTm as)
19151920 ni env (PApp _ f as) = ni env f ++ concatMap (ni env) (map getTm as)
19161921 ni env (PAppBind _ f as) = ni env f ++ concatMap (ni env) (map getTm as)
1917− ni env (PCase _ c os) = ni env c ++
1922+ ni env (PCase _ c os) = ni env c ++
19181923 -- names in 'os', not counting the names bound in the cases
19191924 (nub (concatMap (ni env) (map snd os))
19201925 \\ nub (concatMap (ni env) (map fst os)))
@@ -1944,7 +1949,7 @@ namesIn uvars ist tm = nub $ ni [] tm
19441949 _ -> if n `elem` (map fst uvars) then [n] else []
19451950 ni env (PApp _ f as) = ni env f ++ concatMap (ni env) (map getTm as)
19461951 ni env (PAppBind _ f as) = ni env f ++ concatMap (ni env) (map getTm as)
1947− ni env (PCase _ c os) = ni env c ++
1952+ ni env (PCase _ c os) = ni env c ++
19481953 -- names in 'os', not counting the names bound in the cases
19491954 (nub (concatMap (ni env) (map snd os))
19501955 \\ nub (concatMap (ni env) (map fst os)))
@@ -2003,4 +2008,3 @@ getErasureInfo ist n =
20032008 case lookupCtxtExact n (idris_optimisation ist) of
20042009 Just (Optimise inacc detagg) -> map fst inacc
20052010 Nothing -> []
2006−