|    newtype MyList a = MyList [a]
 | 
 |    myMap1 :: (a -> b) -> MyList a -> MyList b
 |    ...
 |    myMap4 :: (a -> b) -> MyList a -> MyList b

Maybe restricted types would be handy here:

  type MyList a = [a]
    in myMap, ...

  myMap :: (a -> b) -> MyList a -> MyList b
  myMap = map

  ...

Restricted types are at the moment in Hugs and Gofer, but not in the
standard Haskell definition. I like them much better than newtype (you
don't have an extra constructor). The only disadvantage is that they can't
be recursive; they just create a new type.

Regards,
Koen.

--
|  Koen Claessen,                   [EMAIL PROTECTED]  |
|                   http://www.cse.ogi.edu/~kcclaess/  |
|------------------------------------------------------|
|  Visiting student at OGI,    Portland, Oregon, USA.  |



Reply via email to