From Doctest's readme, one can use doctest with QuickCheck, like this:
-- |
-- prop> sort xs == (sort . sort) (xs :: [Int])
I would like to describe this property using multiple lines, probably like
-- |
-- prop> sort xs ==
-- (sort . sort) (xs :: [Int])
Doctest itself supports multi-line input (again from readme)
-- |
-- >>> :{
-- let
-- x = 1
-- y = 2
-- in x + y + multiline
-- :}
-- 6
and I tried several similar syntaxes I came up with, such as
-- |
-- prop> :{ sort xs ==
-- (sort . sort) (xs :: [Int])
-- }:
without any success. (In the example above, the error message is parse error on input '{'
.)
How can I use multi-line input with Quickcheck in doctest?
:{
is not on its own line. – Pepticprop>
recognize multiple lines as the input. – Fruitful