Difference between revisions of "User:PaoloMartini"

From HaskellWiki
Jump to navigation Jump to search
(First revision ;-))
 
(f . g . h = ((f .) . (. h)) g)
Line 11: Line 11:
 
<xerox> I think I deserve an award for that reduction.
 
<xerox> I think I deserve an award for that reduction.
 
<dons> xerox reaches PointFree Hacker, Level 7.
 
<dons> xerox reaches PointFree Hacker, Level 7.
  +
</pre>
  +
  +
<pre>
  +
<xerox> f . g . h = (\x -> f . x . h) g = (\x -> f . (x . h)) g = (\x -> (f .) ((.) x h)) g = ((f .) . (. h)) g
 
</pre>
 
</pre>

Revision as of 13:21, 16 July 2006

\a b c -> a + (b*c)
\a b c -> (+) a ((*) b c)
\a b -> ((+) a) . ((*) b)
\a -> (((+) a) .) . (*)
\a -> (.) ((+ a) .) (*)
\a -> (flip (.)) (*) ((+ a) .)
\a -> (flip (.)) (*) (((.) (+ a))
(flip (.)) (*) . ((.) . (+))

<xerox> I think I deserve an award for that reduction.
<dons> xerox reaches PointFree Hacker, Level 7.
<xerox> f . g . h = (\x -> f . x . h) g = (\x -> f . (x . h)) g = (\x -> (f .) ((.) x h)) g = ((f .) . (. h)) g