Exercise 2.1.1 in DaoFP
bvoq opened this issue · comments
Kevin De Keyser commented
Bartosz Milewski commented
This works too, but the idea is to prove something like, for instance, this:
import Data.Char
f :: Char -> Int
f = ord
g :: Int -> String
g = show
foo, bar :: (x -> Char) -> (x -> String)
foo = \h -> (g . f) . h
bar = (\j -> g . j) . (\h -> f . h)
test :: String -> Char
test = head . drop 1
main = do
print $ (foo test) "abc"
print $ (bar test) "abc"