Saturday, 24 August 2013

Haskell tuple function composition

Haskell tuple function composition

I have started learning Haskell from Introduction to FP using Haskell by
Richard Bird, but I am stuck in proving the following:
pair (f, g) . h = pair (f . h, g . h)
The definitions of pair is the following:
pair :: (a -> b, a -> c) -> a -> (b, c)
pair (f, g) x = (f x, g x)
Could someone point me in the right direction? Please keep in mind that I
am only at the beginning. Thanks in advance!

No comments:

Post a Comment