Sujet : Re: Why don't people like lisp?
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.lispDate : 04. Jul 2024, 20:52:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <871q49vsse.fsf@bsb.me.uk>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Gnus/5.13 (Gnus v5.13)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
On Wed, 03 Jul 2024 18:11:35 -0700, Paul Rubin wrote:
>
In Haskell, max always
takes two args of an ordered type, and maximum takes a list arg.
maximum [2] gives 2 but maximum [] throws an empty list exception.
maximum just applies max repeatedly, like using reduce in Lisp.
>
Seems unnecessary to have two functions when one will do.
Haskell is a typed language so the two functions are quite different,
though the list version can be trivially defined from the binary
function.
-- Ben.