
14 Jan
2008
14 Jan
'08
3:14 a.m.
There is no technical reason for this. It's a matter of taste. As someone
else pointed out, different arities is usually a bug.
-- Lennart
On Jan 13, 2008 3:12 PM, Neil Mitchell
Hi,
It's nice to write functions in point free style:
f = sort . nub
But sometimes I have to add an extra case, on a certain value:
f [] = [1] f = sort . nub
But now these equations have different arities, and its rejected by Haskell. Why does this not simply desugar to:
f [] = [1] f x = (sort . nub) x
i.e. lift the arities to the longest argument list.
Is there a reason this isn't done?
Thanks
Neil _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe