@@ -12,6 +12,7 @@ import Util.Pretty
13import Data.Maybe
13import Data.Maybe
14import Data.List
14import Data.List
15+import qualified Data.Text as T
16-- TODO: Only include names with public/abstract accessibility
17-- TODO: Only include names with public/abstract accessibility
@@ -33,30 +34,32 @@ showDoc d | nullDocstring d = empty
34pprintFD :: Bool -> FunDoc -> Doc OutputAnnotation
35pprintFD :: Bool -> FunDoc -> Doc OutputAnnotation
35pprintFD imp (FD n doc args ty f)
36pprintFD imp (FD n doc args ty f)
36− = nest 4 (prettyName imp [] n <+> colon <+> prettyImp imp ty <$> renderDocstring doc <$>
37+ = nest 4 (prettyName imp [] n <+> colon <+>
38+ pprintPTerm imp [] [ n | (n@(UN n'),_,_,_) <- args
39+ , not (T.isPrefixOf (T.pack "__") n') ] ty <$>
40+ renderDocstring doc <$>
37 maybe empty (\f -> text (show f) <> line) f <>
41 maybe empty (\f -> text (show f) <> line) f <>
38 let argshow = showArgs args [] in
42 let argshow = showArgs args [] in
39 if not (null argshow)
43 if not (null argshow)
40 then nest 4 $ text "Arguments:" <$> vsep argshow
44 then nest 4 $ text "Arguments:" <$> vsep argshow
41 else empty)
45 else empty)
43− where showArgs ((n, ty, Exp {}, d):args) bnd
47+ where showArgs ((n, ty, Exp {}, Just d):args) bnd
44 = bindingOf n False <+> colon <+>
48 = bindingOf n False <+> colon <+>
45− pprintPTerm imp bnd ty <>
49+ pprintPTerm imp bnd [] ty <>
46− showDoc (maybe emptyDocstring id d) <> line
50+ showDoc d <> line
48 showArgs args ((n, False):bnd)
52 showArgs args ((n, False):bnd)
49− showArgs ((n, ty, Constraint {}, d):args) bnd
53+ showArgs ((n, ty, Constraint {}, Just d):args) bnd
50 = text "Class constraint" <+>
54 = text "Class constraint" <+>
51− pprintPTerm imp bnd ty <> showDoc (maybe emptyDocstring id d) <> line
55+ pprintPTerm imp bnd [] ty <> showDoc d <> line
53 showArgs args ((n, True):bnd)
57 showArgs args ((n, True):bnd)
54− showArgs ((n, ty, Imp {}, d):args) bnd
58+ showArgs ((n, ty, Imp {}, Just d):args) bnd
56 = text "(implicit)" <+>
59 = text "(implicit)" <+>
57 bindingOf n True <+> colon <+>
60 bindingOf n True <+> colon <+>
58− pprintPTerm imp bnd ty <>
61+ pprintPTerm imp bnd [] ty <>
59− showDoc d' <> line
62+ showDoc d <> line
61 showArgs args ((n, True):bnd)
64 showArgs args ((n, True):bnd)
62 showArgs ((n, _, _, _):args) bnd = showArgs args ((n, True):bnd)
65 showArgs ((n, _, _, _):args) bnd = showArgs args ((n, True):bnd)