iso1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Follow the type and the properties 

f :: Either a a -> (Bool, a)
f (Left x) = (False, x)
f (Right x) = (True, x)

g :: (Bool, a) -> Either a a
g (True, x) = Right x
g (False, x) = Left x

-- |
-- prop> (f . g) x == x
-- prop> (g . f) x == x