What's missing from Phobos for Orbit (package manager)

bearophile bearophileHUGS at lycos.com
Thu Feb 14 00:32:39 PST 2013


Walter Bright:

> The trivial ones should not be added to Phobos,

The situation is not that simple. Just a general (not specific) 
note on this topic: Haskell has a standard module named "Prelude" 
that is usually loaded automatically at the start. It contains 
several commonly useful functions, types and constants:

http://www.haskell.org/onlinereport/standard-prelude.html

You can think of lot of the stuff you see in the Prelude as 
"trivial", like concatMap, that is just one line of very simple 
code (plus a first optional line that gives its type):


concatMap :: (a -> [b]) -> [a] -> [b]
concatMap f = concat . map f


Yet I think most Haskell programmers think it's a good idea to 
keep that stuff there. concatMap becomes a "chunk" so it reduces 
the thinking load of the programmer. And in some libraries there 
are "alternative" versions of concatMap that work on different 
types, like "packed" vectorized sequences, that are faster, but 
with the the same usage for the programmer.

Bye,
bearophile


More information about the Digitalmars-d mailing list