
28 Dec
2007
28 Dec
'07
6:24 a.m.
2007/12/28, Alfonso Acosta
@ works as an aliasing primitive for the arguments of a function
f x@(Just y) = ...
using "x" in the body of f is equivalent to use "Just y". Perhaps in this case is not really useful, but in some other cases it saves the effort and space of retyping really long expressions. And what is even more important, in case an error is made when choosing the pattern, you only have to correct it in one place.
And in plenty of case it will greatly boost your speed because you won't be reconstructing the objects against which you matched every time you want to return them unchanged. -- Jedaï