on master help sign in
Make ':doc' say 'No constructors.' when a data type has no constructors.
commitf1d8f867f0d16b307d09e68236318cfba5b256e4 authorPaul Koerbitz <paul.koerbitz@theppro.com> dateTue 6 May 2014, 21:52 (12 years ago) parent45e0a6b
1 file changed+3−2
src/Idris/Docs.hs+3−2
src/Idris/Docs.hs+3−2
@@ -74,8 +74,9 @@ pprintDocs :: IState -> Docs -> Doc OutputAnnotation
7474pprintDocs ist (FunDoc d) = pprintFD ist d
7575pprintDocs ist (DataDoc t args)
7676 = text "Data type" <+> pprintFD ist t <$>
77− nest 4 (text "Constructors:" <> line <>
78− vsep (map (pprintFD ist) args))
77+ if null args then text "No constructors."
78+ else nest 4 (text "Constructors:" <> line <>
79+ vsep (map (pprintFD ist) args))
7980pprintDocs ist (ClassDoc n doc meths params instances)
8081 = nest 4 (text "Type class" <+> prettyName (ppopt_impl ppo) [] n <>
8182 if nullDocstring doc then empty else line <> renderDocstring doc)