[Haskell-cafe] Question, re: Typeclassopedia Ex. 4.2.1

David Banas capn.freako at gmail.com
Tue Sep 29 14:48:05 UTC 2015


Hi all,

In trying to solve exercise 4.2.1 in Typeclassopedia, I’ve come up with the following:

To prove:
pure f <*> x = pure (flip ($)) <*> x <*> pure f
Proof:
pure (flip ($)) <*> x <*> pure f     = (interchange)
pure (flip ($)) <*> pure ($ f) <*> x = (homomorphism)
pure (flip ($) ($ f)) <*> x          = (definition of flip)
pure ($ ($ f)) <*> x                 = (interchange)
x <*> pure ($ f)                     = (interchange) (Is this step valid?)
pure f <*> x
Is the last step in my proof valid?

Thanks,
-db

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150929/a7a90456/attachment.html>


More information about the Haskell-Cafe mailing list