Commit 4f105dc4 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improve test

parent f6b121ab
......@@ -26,6 +26,6 @@ f (Y x) = g maybeToInt x
-- g :: Functor f => (f Int -> b) -> f (Y Maybe) -> b
g h x = h $ fmap f x
-- 'test' calls g at two different types, f=[] and f=Maybe
test = (g (sum :: [Int] -> Int) [],
g isJust Nothing)
-- 'test' checks that g's type is polymophic enough
test :: Functor f => (f Int -> b) -> f (Y Maybe) -> b
test = g
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment