Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: ANN: Ramda, a new functional programming library Date: Tue, 3 Jun 2014 22:01:45 +0100 Organization: Home Lines: 66 Message-ID: <2PRbYy35ejjTFwYN@invalid.uk.co.demon.merlyn.invalid> References: <1wrr3wcXt2iTFwiZ@invalid.uk.co.demon.merlyn.invalid> <586acd4a-249d-4a91-a71a-9cd6187634dd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="01da9e6251d9b3ee47bb70bebae42d53"; logging-data="18274"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Sx5HNSr49QByL6aP1FmrwNbpgKYF1igQ=" User-Agent: Turnpike/6.05-S () Cancel-Lock: sha1:TA25m5XkD3UYX1e9b6gWhaafL/U= Xref: csiph.com comp.lang.javascript:24593 In comp.lang.javascript message <586acd4a-249d-4a91-a71a-9cd6187634dd@go oglegroups.com>, Sun, 1 Jun 2014 19:28:38, Scott Sauyet posted: >Dr J R Stockton wrote: >> Scott Sauyet posted: >> >>> I'm looking for feedback on a new functional programming library for >>> Javascript that I've been developing with a friend. [ ... ] >> >> If the library is not being written IN JavaScript (or even if it is), >> you could consider implementing (maybe more efficiently) the improved >> date object in . [ ... ] > >Although that looks to be interesting code, and an improvement on >the existing Date constructor function in several important ways, I >don't think it would be a good fit for Ramda. > >Ramda is about offering functional programming (FP) tools to the >user. > ... Not only do I not understand how to use FP, I don't understand many of the words used in writing about it. And I doubt whether I ever will. >DATE2 is an OO construct, a constructor function with a beefy >prototype object. It creates mutable objects, usually a no-no in FP >code, and it carries a great deal of inaccessible internal state. >These features are fine for OO, but not for FP. Inaccessible internal state? AFAIR, and you'll have noticed the date of the page, there should not be any. There is accessible state such as DATE2.GMT, and there are internal variables in methods, and there is the accessible date value. Otherwise, could you name an example? The beefiness to which you refer is, I think, because DATE2 handles for I/O many standard date formats, including ISO week numbering and (IIRC) YMD using a single Roman character for the month, I-XII or i-xii. Also it has to work round vexing features of the standard Object, such as new Date(14, 7, 4) giving the (UK) start of WWI rather than a date in the Year of the Consulship of Pompeius and Appuleius (767 AUC). I think it would look simpler if it were implemented not IN JavaScript but BY those who have coded the JavaScript Date Object in whatever language was used. OTOH, the Object does not do as much as it could about the dates of Summer Time (I've only recently discovered that the end of Summer Time can depend on the date of Easter Sunday). >I have a talk I've given several times discussing the ideas involved >in functional programming as applied to Javascript. [1] >[1] Includes "Not available in current versions Javascript" on slide 22. Trivial - needs an "of". Important - Web pages persist, so there should be a "current date" value given at the beginning. -- (c) John Stockton, nr London, UK. E-mail, see Home Page. Turnpike v6.05. Website - w. FAQish topics, links, acronyms PAS EXE etc. : - see in 00index.htm Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.