Open BatiDyDx opened 6 months ago
Did you enable OverloadedStrings? It’s what allows using String
literals directly as Doc ann
directly.
It might be nice if the example mentioned OverloadedStrings
. Plus the imports needed: not just Prettyprinter
, but also Prettyprinter.Util
. These things won't be obvious to beginners.
Another thing I've just noticed, while adapting the example, is that the example only works in GHCI due to ExtendedDefaultRules
, and thus doesn't work straight away when copied in to a source file.
It might be nice if the example mentioned
OverloadedStrings
. Plus the imports needed: not justPrettyprinter
, but alsoPrettyprinter.Util
. These things won't be obvious to beginners.
Ha, I'm not the first to say this: https://github.com/quchen/prettyprinter/issues/209#issuecomment-966483759. Perhaps this issue should be closed in favour of that one.
The example shown on the module main page, the
prettyprintType
function, is actually not type checking due to theString
list of separators. It is rather expected a[Doc ann]
type element.