Skip to content

Instantly share code, notes, and snippets.

@co-dan
Created January 5, 2013 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save co-dan/4463444 to your computer and use it in GitHub Desktop.
Save co-dan/4463444 to your computer and use it in GitHub Desktop.
> showReadIso :: Expr -> Bool
> showReadIso e = parseExpr (show' e) == e
*Tests> quickCheck showReadIso
*** Failed! Falsifiable (after 34 tests):
Prod (Variable "d") (Prod (Variable "b") (Universe 9) (Prod (Variable "a") (Prod (Variable "c") (Var (Variable "a")) (App (Lambda (Variable "c") (Var (Variable "b")) (Universe 8)) (Prod (Variable "a") (Universe 1) (Var (Variable "c"))))) (Prod (Variable "b") (Lambda (Variable "c") (App (Universe 2) (Universe 5)) (Var (Variable "c"))) (App (Var (Variable "b")) (Lambda (Variable "d") (Var (Variable "a")) (Universe 7)))))) (App (Prod (Variable "a") (Lambda (Variable "d") (Universe 9) (Prod (Variable "a") (App (Var (Variable "b")) (Var (Variable "d"))) (App (Var (Variable "a")) (Var (Variable "a"))))) (Prod (Variable "a") (App (Prod (Variable "c") (Var (Variable "b")) (Var (Variable "c"))) (Prod (Variable "d") (Var (Variable "b")) (Universe 10))) (Prod (Variable "d") (Lambda (Variable "a") (Var (Variable "c")) (Var (Variable "d"))) (Prod (Variable "c") (Universe 5) (Var (Variable "c")))))) (App (Lambda (Variable "d") (App (Universe 8) (App (Var (Variable "c")) (Universe 2))) (Var (Variable "d"))) (App (Universe 9) (Lambda (Variable "b") (App (Var (Variable "d")) (Universe 1)) (App (Universe 9) (Var (Variable "a")))))))
it :: ()
(0.04 secs, 17345176 bytes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment