less than serious - PreludeExts

Volker Stolz stolz at i2.informatik.rwth-aachen.de
Mon Jan 19 10:24:20 EST 2004

In local.libraries, you wrote:
>     box x = [x]
>     map box xs
>     map (\x -> [x]) xs
> is more self contained, and not much longer.  (I don't mean any
> offence to the author and users of 'box'; it's a matter of personal
> preference, how big a function neds to be before it deserves a name.)

I always thought it was natural to use
   map return xs
(obviously with the right context for "return"). It's a pity that
'singleton' went away (or did it never exist in the Prelude at all?).

http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
rage against the finite state machine 

More information about the Libraries mailing list