From cd0a83eac43f13979c3b5c830e9486750ae508cf Mon Sep 17 00:00:00 2001 From: Jon Laing Date: Sat, 18 Nov 2017 21:06:06 -0500 Subject: [PATCH] published to npm --- README.md | 9 +++++---- package.json | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a4fbf14..d07d902 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Note that not all of Ramda was ported over, as many of Ramda's utilities are mak Features -------------------------------------------------------------------------------- -### Exception-free List oprations +### Exception-free List operations In the OCaml/ReasonML standard library, many of the common List operations throw exceptions if there's a problem. Rationale's utilities do not throw exceptions, and instead return `options`. @@ -122,7 +122,6 @@ swapLast([], [4,5,6]); /* [4,5,6] */ /* Or, with infix operators */ open Option.Infix; -open Option.Infix; let swapLast = (xs, ys) => RList.last(xs) >>= ((x) => RList.init(ys) <$> RList.append(x)) |> Option.default(ys); @@ -145,13 +144,15 @@ lastEqual([], [4,5,6]); /* false */ lastEqual([1,2,3], []); /* false */ /* Or, with infix operators */ +open Option.Infix; + let lastEqual = (xs, ys) => Some(Util.eq) <*> RList.last(xs) <*> RList.last(ys) |> Option.default(false); ``` ### Translating JS Idioms -### Or chains +#### Or chains Take the following example in Javascript: @@ -177,7 +178,7 @@ Reference - `>>=`: Monadic Bind - `<$>`: Functor Fmap -- `<*>`: Applicative Ap +- `<*>`: Applicative Apply - `<||`: Point-free Function Compose - `||>`: Point-free Function Pipe - `-<<`: Lens Compose diff --git a/package.json b/package.json index 551fffe..b86dd83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "rationale", - "version": "0.1.0", + "version": "0.1.1", + "description": "Rationale is a collection of helper utility functions that are absent in the OCaml/ReasonML standard library.", "scripts": { "build": "bsb -clean-world -make-world", "watch": "bsb -clean-world -make-world -w",