Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: library for fast map/filter/reduce Date: Sat, 20 Feb 2016 13:59:42 +0000 Organization: A noiseless patient Spider Lines: 24 Message-ID: <87lh6f32k1.fsf@bsb.me.uk> References: <9f70cd71-da91-478c-ac97-392fcb7c7a63@googlegroups.com> <8e0eb84d-66c8-41da-847b-759f634bc4cd@googlegroups.com> <286742ed-e3f3-466f-9b4d-b9deb5bb4442@googlegroups.com> <56e25c80-9c8e-4113-a6ad-07d7c321b5db@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="23227"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rcL80iYS7neD7g6ejGsTn//F4+mxbTIc=" Cancel-Lock: sha1:9lX5ouwXRjExgbQWs4mGKclQp7k= sha1:4RIjSZ1Gt51ICrfVQhdY/6mCuFM= X-BSB-Auth: 1.9595ed615304c78de9f5.20160220135942GMT.87lh6f32k1.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:29642 glathoud writes: > Side note about lambdas: it would be nice to be able to write some > without variables at all. OCaml has an interesting notation where one > can wrap an operator + into a function (+) Haskell has that too, and it came (at least in the case of Haskell), from Miranda designed by David Turner. He may have got it from a 1973 dissertation by Wile and (like so many such things) it probably has even older roots in mathematical logic. Haskell (and Miranda) can go both ways. (+) is a function make from an operator, but given a function like mod, you can make an operator from it using `...`: 95 `mod` 10 is 5. And you can combine the two. Since operators permit sections using either operand it can be handy to write (`mod` 10) for the "modulo 10" function. -- Ben.