Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #24493
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2014-05-30 12:44 -0700 |
| References | <da2909bd-58cc-4183-8b3c-167039985491@googlegroups.com> <02dfeef2-b8fa-4cc3-8c6f-d375a43278ca@googlegroups.com> <2c61b020-8e0c-4a3b-a021-f7058aed52dc@googlegroups.com> |
| Message-ID | <72aa659a-997d-4d1a-97bb-87ffef38978c@googlegroups.com> (permalink) |
| Subject | Re: ANN: Ramda, a new functional programming library |
| From | John C <rescattered@gmail.com> |
On Friday, May 30, 2014 2:23:48 PM UTC-4, Scott Sauyet wrote: > John C wrote: > > > Scott Sauyet wrote: > > >> [ ... ] > > >> <https://github.com/CrossEye/ramda> > > >> [ ... ] > > >> I'd love for experienced people to look at the functions and see what > > >> is missing, what is totally unnecessary, and what could use a better > > >> name or at least an alias. In the latter category, I really would > > >> like to find a better name for `foldl1`, whose name was borrowed from > > >> Haskell. It's the difference between a left fold with an explicit > > >> accumulator supplied: > > >> > > >> var total = foldl(add, 0, range(1, 11)) // => 55 > > >> > > >> and one where the first value of the (non-empty) list is taken as the accumulator: > > >> > > >> var total2 = foldl1(add, range(1, 11)); // => 55 > > >> > > >> With the automatic partial application of functions, there is no good > > >> way to allow for dynamic functions signatures, so I can't simply > > >> assume that `foldl` with two parameters means something different from > > >> `foldl` with one. So a good name to replace `foldl1` would be very > > >> helpful. Similarly, of course, for `foldr1`. [ ... ] > > > > > As far as your name for foldl1 goes -- how about selfFoldl since in > > > that case it folds in on itself (as opposed to folding on an externally > > > given item)? Another idea is something like "rollUp" > > > > Those both sound quite good. Thank you for the suggestions. > > > > The funny thing is that I'd forgotten we'd taken these out of the library in response to a disagreement over how to handle the case where the user supplied an empty list. At some point we'll probably put them back, but they're not there now. When they do come back, maybe we'll use `selfFoldl`. > > > > Thanks, > > > > -- Scott Out of curiosity -- what was the disagreement? Returning undefined seems like the natural choice since the result is, well, undefined in this case. Is the concern with the way undefined is sometimes quirky in javascript?
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-27 20:13 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-27 21:00 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 04:37 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 04:36 -0700
Re: ANN: Ramda, a new functional programming library "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-05-28 08:49 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 15:59 -0700
Re: ANN: Ramda, a new functional programming library "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-05-28 16:15 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-28 17:05 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-30 14:53 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:14 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-05-29 19:40 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-29 17:55 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-30 14:05 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:10 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 06:25 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 11:23 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 12:44 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-30 13:39 -0700
Re: ANN: Ramda, a new functional programming library John C <rescattered@gmail.com> - 2014-05-30 19:17 -0700
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-05-31 09:52 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-31 22:24 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 06:55 -0700
Re: ANN: Ramda, a new functional programming library Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-31 21:00 +0200
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 06:54 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-01 19:05 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-01 19:28 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-03 22:01 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-03 19:15 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-05 23:41 +0100
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-06 11:36 -0700
Re: ANN: Ramda, a new functional programming library Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-06-07 23:13 +0100
Re: ANN: Ramda, a new functional programming library billyroberts111@gmail.com - 2016-03-06 10:22 -0800
Re: ANN: Ramda, a new functional programming library Scott Sauyet <scott.sauyet@gmail.com> - 2016-03-06 17:52 -0800
Re: ANN: Ramda, a new functional programming library "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-03-07 10:50 +0100
csiph-web