
29 Jul
2012
29 Jul
'12
2:30 p.m.
Thiago Negri wrote:
What's the advantage of using this: (value . square . successor . lift) 4 data Lift a = Function a lift = Function successor (Function a) = lift (a + 1) square (Function a) = lift (a * a) value (Function a) = a
Over this: (square . successor) 4 successor = (+1) square a = a * a
Oops! There's no advantage, that I can see, of the former over the latter. Thanks Thiago for pointing this out. This is very helpful. It helps me to avoid continuing on a wrong course of thought. /Roger