<div dir="ltr"><div><br></div><div>Dear café,</div><div><br></div><div>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</div><div><br></div><div><i>data Guarded a =<br></i></div><div><i>      Errors (NE.NonEmpty CtxError) <br>    | Checked a [Warning]<br></i></div><div><i><br></i></div><div><div><i>parseFoo :: Text -> Guarded Foo</i></div><div><i>prettyFoo :: Foo -> Text</i><br></div><div><br></div><div>The idea is that for all foo :: Foo, the following holds:</div><div>    <i>parseFoo . prettyFoo $ foo</i>  should be equal to  <i>Checked foo []</i></div><div><br></div><div>Now, if there is a counterexample, I would like to see prettyFoo foo as output, folowed by the show of the Errors part. </div><div><br></div><div>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. </div><div><br></div><div>Any help would be appreciated!</div><div><br></div><div>Thanks</div><div>Han</div><div>   </div><div></div></div></div>