Skip to content

Commit

Permalink
Add signatures to test, to further verify name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Dec 20, 2016
1 parent 3f9d7df commit fff9365
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/Expr.hs
Expand Up @@ -54,13 +54,16 @@ main = do
"bar" @=? cata lAlg lBar
lBar @=? ana lCoalg "bar"

let expr3 = Add2 (Lit2 (21 :: Int)) $ Add2 (Lit2 11) (Lit2 10)
let expr3 = Add2 (Lit2 21) $ Add2 (Lit2 11) (Lit2 10)
42 @=? cata evalAlg2 expr3
where
-- Type signatures to test name generation
evalAlg :: ExprF Int Int -> Int
evalAlg (LitF x) = x
evalAlg (AddF x y) = x + y
evalAlg (x :*$ y) = foldl' (*) x y

evalAlg2 :: Expr2_ Int Int -> Int
evalAlg2 (Lit2' x) = x
evalAlg2 (Add2' x y) = x + y

Expand Down

0 comments on commit fff9365

Please sign in to comment.