[Haskell-cafe] Need advise with using Quickcheck
han.joosten.han at gmail.com
Fri Jun 11 21:16:43 UTC 2021
I want to implement a roundtrip test for a parser/prettyprinter
combination. Let me try to explain what I am struggling with. I start with
some type definitions of functions I have
*data Guarded a =*
* Errors (NE.NonEmpty CtxError) | Checked a [Warning]*
*parseFoo :: Text -> Guarded Foo*
*prettyFoo :: Foo -> Text*
The idea is that for all foo :: Foo, the following holds:
*parseFoo . prettyFoo $ foo* should be equal to *Checked foo *
Now, if there is a counterexample, I would like to see prettyFoo foo as
output, folowed by the show of the Errors part.
I have been struggling to get this working, but without luck so far. I am
not very familiar with Quickcheck, so that could be the problem too.
Any help would be appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe