map and fmap
john at repetae.net
Mon Aug 21 19:32:09 EDT 2006
On Fri, Aug 18, 2006 at 05:30:53PM +0200, John Hughes wrote:
> on students having Haskell' books. All that time, students would write map
> instead of mapList because that's what the book says, and get stuck with
> incomprehensible error messages. Is it really worth an incompatible change
> in the library functions used by all beginners, just to rename fmap to map?
> It seems to me that the gain from a change is very small, and the cost
Yeah, the change doesn't seem worth it to me. And I still have concerns
about ambiguity errors, if a beginner ever has to use an explicit type
signature it sort of ruins the whole "type inference" benefit. I think
everyone has tried to write
class Cast a b where
cast :: a -> b
at some point but found it not very useful as whenever it was fed or
used as an argument to another overloaded function, you ended up with
with all the added generality being added all over the place, you need
collections of functions that work on concrete data types to 'fix'
things every now and again. lists are common enough that I think they
deserve such 'fixing' functions. And it has nothing to do with newbies.
having to write type annotations when not even doing anything tricky is
not an acceptable solution for a type infered language.
John Meacham - ⑆repetae.net⑆john⑈
More information about the Haskell-prime