I would like to add a property in my haddock documentation that spans multiple lines.
For example, I would like to do the following:
-- prop> a <= b &&
-- prop> b <= c ==>
-- prop> a <= c
I would like to add a property in my haddock documentation that spans multiple lines.
For example, I would like to do the following:
-- prop> a <= b &&
-- prop> b <= c ==>
-- prop> a <= c
It seems this isn’t currently supported. In the latest version, haddock-library-1.11.0, the parser for such properties in Documentation.Haddock.Parser
just grabs characters until the end of the line:
property :: Parser (DocH mod a)
property = DocProperty . T.unpack . T.strip <$> ("prop>" *> takeWhile1 (/= '\n'))
I haven’t tried this, but at a guess, maybe as a workaround you could use a different Unicode line-breaking character such as VT (U+000B), FF (U+000C), NEL (U+0085), or LS (U+2028). The Haskell 2010 Report §2.2 Lexical Program Structure specifies that all of these characters should be considered valid whitespace, and additionally treats FF as a newline for the purposes of comments (and presumably layout). However, you would need to omit -- prop>
from the continuation lines, and this might break other things that assume the property is a single line only.