On Tue, 12 May 1998, Mariano Suarez Alvarez wrote:

 | On Tue, 12 May 1998, Koen Claessen wrote:
 | 
 | >   map :: (a -> b) -> [a] -> [b]
 | >   map f (x:xs) = f x : map f xs
 | >   map f xs     = xs
 | 
 | Where is the CSE in theis def of map? Why is it naive? (Hugs & ghc define
 | map on lists exactly like that.) Maybe I'm naive...

Sorry, I was too brief. I meant this: the third line

  map f xs = xs

does not type check. It should be:

  map f [] = []

Regards,
Koen.

--
Koen Claessen,
[EMAIL PROTECTED],
http://www.cs.chalmers.se/~koen,
Chalmers University of Technology.


Reply via email to