Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24459

Re: ANN: Ramda, a new functional programming library

Newsgroups comp.lang.javascript
Date 2014-05-28 15:59 -0700
References <da2909bd-58cc-4183-8b3c-167039985491@googlegroups.com> <737583eb-f24f-4f9a-a221-4c1677f59932@googlegroups.com>
Message-ID <ead75684-b2f7-4ea2-b758-02fac986f26b@googlegroups.com> (permalink)
Subject Re: ANN: Ramda, a new functional programming library
From Scott Sauyet <scott.sauyet@gmail.com>

Show all headers | View raw


Michael Haufe (TNO) wrote:
> Scott Sauyet wrote:

>> I've been away from this group a while, and probably will not be 
>> around for long this time, as I'm pretty buried in several projects 
>> that haven't left me much spare time.  But I wanted to announce my 
>> current project.  I'll check in regularly for a while to read responses.
>> [...]
> 
> Would you mind giving me an update on things since our last conversations? 
> 
> https://groups.google.com/d/topic/jsmentors/0Cj7AEH5Oic/discussion
> https://groups.google.com/d/topic/jsmentors/wH6X8SDPnbw/discussion

Regarding ideas about functional composition discussed in one of those 
threads, this library does not attempt to address anything but the 
standard notion of `compose` used in many FP contexts, although it 
also adds `pipe`, which simply does the same thing with the arguments 
in the reverse order.  For example,

    var factorial = compose(product, range(1), add(1));

is equivalent to 

    var factorial = pipe(add(1), range(1), product);

(As discussed previously, our `range` is inclusive on the left, 
exclusive on the right, which necessitates the `add(1)` call.)

I find `pipe` more intuitive than `compose`, but obviously there's not 
much difference.  We do have one other compose-like function included, 
the `useWith` mentioned in the OP.  I have given a brief talk on 
functional composition in several forums; the slides are here:

    <http://scott.sauyet.com/Javascript/Talk/Compose/>

------------------------------ 

The other thread was a long-ranging discussion about the predecessor 
to ramda, a library called eweda.  Although the original goal of eweda 
was to be a practical library, we quickly became seduced by 
implementation elegance and did not build a very performant or, in the 
end, a very useful library.  Ramda takes a very different approach.  
The library tries to be efficient and useful.  It keeps the same API 
as eweda, focusing on simple, composable, pre-curried functions that 
do much of the standard list-, object-, string-, number-, and 
function-manipulation that you might expect.

There are probably few surprises in Ramda for someone who has 
programmed in a functional language.  The ideas was to take some of 
the things that are most sorely missed when switching to Javascript 
and make them available.  Next up will be the algebraic data types.

This library does not have the replaceable core list implementation 
featured in eweda.  Its lists are arrays.  It does, though have the 
ability to deal with infinite lazy lists created by generators.  (We 
are in the process of trying to build a bundling system; these lazy 
lists may well end up being an optional feature not included in the 
core bundle, but the code is available, and still included by default 
at the moment.)

The biggest change from those discussions is one of maturity.  The 
library has grown, become better tested, more hardened, and I'm 
hoping, more all-around useful.  It no longer feels like an API 
experiment; it feels like a working product.

HTH,

  -- Scott

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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