Closed bvoq closed 1 year ago
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"
Hello, great book! I've gotten very confused with the exercise at 2.1.1:
Shouldn't the exercise instead be to prove? $((g \circ f) \circ -) = (g \circ (f \circ -))$