
j.waldmann wrote on 08.05.2009 17:39:
Wow. This is really a bikeshed discussion. My post contained praise for the book, a critique of one of its design decisions (intermediate language not explicitely typed), and a syntactical remark. Guess what the discussion is about. (This is also known as http://www.haskell.org/haskellwiki/Wadlers_Law)
If you're advocating (f.g) = \ x -> f(g(x)), then:
1. Define composition of relations.
R1 . R2 = {(x, y) | \exists z : (x, z) \in R2 & (z, y) \in R1} That's the definition I've usually seen. (If I'm not mistaken).
2. Is a function a special case of a relation?
Depends on the definition (i.e., some books define a relation on (A,B) as a subset in A\times B, and a function A -> B as a triple (A, B, G), where G is a subset in A\times B), but, generally speaking, yes.