
Juan Carlos Arevalo Baeza
Seems to me like Haskell could do with a better list primitive, where you can pattern-match on either side (with two constructors, so to speak).
It does have "better" lists - Chris Okasaki's Edison library provides a wholbunch of variants on lists (plus trees plus lookup tables plus ...). Of course, "better" depends on what you want it for. The cool thing about Haskell is that the difference between being primitive and non-primitive is a lot smaller than in most other languages. Usually it amounts to using slightly less concise syntactic sugar.
Seems like "reverse" doesn't do its work recursively after all. Could it be a primitive?
It's just normal code. Note that "recursive" doesn't (necessarily) mean "stack hungry" in functional languages. Only imperative languages feel compelled to guarantee that infinitely recursive functions will run out of stack space. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/