From 0853d0a592233fd602e8167760e33812d1870fa8 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Sun, 26 Feb 2017 18:10:41 +0100 Subject: [PATCH] Version 0.12.2 --- Makefile | 2 +- README.md | 360 +++++++++++++++++++++++++-------------------------- index.js | 2 +- package.json | 2 +- 4 files changed, 183 insertions(+), 183 deletions(-) diff --git a/Makefile b/Makefile index 7db5bceb..90c285c8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ISTANBUL = node_modules/.bin/istanbul NPM = npm REMEMBER_BOWER = node_modules/.bin/remember-bower TRANSCRIBE = node_modules/.bin/transcribe -XYZ = node_modules/.bin/xyz --repo git@github.com:sanctuary-js/sanctuary.git --script scripts/prepublish +XYZ = node_modules/.bin/xyz --branch 0.12.x --repo git@github.com:sanctuary-js/sanctuary.git --script scripts/prepublish .PHONY: all diff --git a/README.md b/README.md index b8eacdcc..14129364 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ const S = create({checkTypes: checkTypes, env: env}); ## API -

create :: { checkTypes :: Boolean, env :: Array Type } -> Module

+

create :: { checkTypes :: Boolean, env :: Array Type } -⁠> Module

Takes an options record and returns a Sanctuary module. `checkTypes` specifies whether to enable type checking. The module's polymorphic @@ -250,7 +250,7 @@ const S = create({ See also [`env`](#env). -

env :: Array Type

+

env :: Array Type

The default environment, which may be used as is or as the basis of a custom environment in conjunction with [`create`](#create). @@ -277,7 +277,7 @@ The following are all equivalent (`_` represents the placeholder): - `f(_, _, z)(x, y)` - `f(_, _, z)(_, y)(x)` -

__ :: Placeholder

+

__ :: Placeholder

The special [placeholder](#placeholder) value. @@ -291,7 +291,7 @@ The special [placeholder](#placeholder) value. ### Classify -

type :: Any -> String

+

type :: Any -⁠> String

Returns the [type identifier][] of the given value. @@ -303,7 +303,7 @@ Returns the [type identifier][] of the given value. 'Array' ``` -

is :: TypeRep a -> Any -> Boolean

+

is :: TypeRep a -⁠> Any -⁠> Boolean

Takes a [type representative](#type-representatives) and a value of any type and returns `true` if the given value is of the specified @@ -322,7 +322,7 @@ false ### Showable -

toString :: Any -> String

+

toString :: Any -⁠> String

Alias of [`Z.toString`][]. @@ -344,7 +344,7 @@ Alias of [`Z.toString`][]. Sanctuary is compatible with the [Fantasy Land][] specification. -

equals :: Setoid a => a -> a -> Boolean

+

equals :: Setoid a => a -⁠> a -⁠> Boolean

Curried version of [`Z.equals`][] which requires two arguments of the same type. @@ -364,7 +364,7 @@ true true ``` -

concat :: Semigroup a => a -> a -> a

+

concat :: Semigroup a => a -⁠> a -⁠> a

Curried version of [`Z.concat`][]. @@ -382,7 +382,7 @@ Curried version of [`Z.concat`][]. Just([1, 2, 3, 4, 5, 6]) ``` -

empty :: Monoid a => TypeRep a -> a

+

empty :: Monoid a => TypeRep a -⁠> a

[Type-safe][sanctuary-def] version of [`Z.empty`][]. @@ -397,7 +397,7 @@ Just([1, 2, 3, 4, 5, 6]) {} ``` -

map :: Functor f => (a -> b) -> f a -> f b

+

map :: Functor f => (a -⁠> b) -⁠> f a -⁠> f b

Curried version of [`Z.map`][]. @@ -430,7 +430,7 @@ from combinatory logic (i.e. [`compose`](#compose)): 10 ``` -

bimap :: Bifunctor f => (a -> b) -> (c -> d) -> f a c -> f b d

+

bimap :: Bifunctor f => (a -⁠> b) -⁠> (c -⁠> d) -⁠> f a c -⁠> f b d

Curried version of [`Z.bimap`][]. @@ -442,7 +442,7 @@ Left('FOO') Right(8) ``` -

promap :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d

+

promap :: Profunctor p => (a -⁠> b) -⁠> (c -⁠> d) -⁠> p b c -⁠> p a d

Curried version of [`Z.promap`][]. @@ -451,7 +451,7 @@ Curried version of [`Z.promap`][]. 11 ``` -

alt :: Alt f => f a -> f a -> f a

+

alt :: Alt f => f a -⁠> f a -⁠> f a

Curried version of [`Z.alt`][]. @@ -469,7 +469,7 @@ Right(1) Right(2) ``` -

zero :: Plus f => TypeRep f -> f a

+

zero :: Plus f => TypeRep f -⁠> f a

[Type-safe][sanctuary-def] version of [`Z.zero`][]. @@ -484,7 +484,7 @@ Right(2) Nothing ``` -

reduce :: Foldable f => (b -> a -> b) -> b -> f a -> b

+

reduce :: Foldable f => (b -⁠> a -⁠> b) -⁠> b -⁠> f a -⁠> b

Takes a curried binary function, an initial value, and a [Foldable][], and applies the function to the initial value and the Foldable's first @@ -504,11 +504,11 @@ See also [`reduce_`](#reduce_). [5, 4, 3, 2, 1] ``` -

reduce_ :: Foldable f => ((b, a) -> b) -> b -> f a -> b

+

reduce_ :: Foldable f => ((b, a) -⁠> b) -⁠> b -⁠> f a -⁠> b

Variant of [`reduce`](#reduce) which takes an uncurried binary function. -

traverse :: (Applicative f, Traversable t) => TypeRep f -> (a -> f b) -> t a -> f (t b)

+

traverse :: (Applicative f, Traversable t) => TypeRep f -⁠> (a -⁠> f b) -⁠> t a -⁠> f (t b)

Curried version of [`Z.traverse`][]. @@ -526,7 +526,7 @@ Just([10, 11, 12]) Nothing ``` -

sequence :: (Applicative f, Traversable t) => TypeRep f -> t (f a) -> f (t a)

+

sequence :: (Applicative f, Traversable t) => TypeRep f -⁠> t (f a) -⁠> f (t a)

Curried version of [`Z.sequence`][]. @@ -541,7 +541,7 @@ Just([1, 2, 3]) Nothing ``` -

ap :: Apply f => f (a -> b) -> f a -> f b

+

ap :: Apply f => f (a -⁠> b) -⁠> f a -⁠> f b

Curried version of [`Z.ap`][]. @@ -568,7 +568,7 @@ from combinatory logic: 'Hask' ``` -

lift2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c

+

lift2 :: Apply f => (a -⁠> b -⁠> c) -⁠> f a -⁠> f b -⁠> f c

Promotes a curried binary function to a function which operates on two [Apply][]s. @@ -587,7 +587,7 @@ Just(true) Just(false) ``` -

lift3 :: Apply f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d

+

lift3 :: Apply f => (a -⁠> b -⁠> c -⁠> d) -⁠> f a -⁠> f b -⁠> f c -⁠> f d

Promotes a curried ternary function to a function which operates on three [Apply][]s. @@ -600,7 +600,7 @@ Just(6) Nothing ``` -

apFirst :: Apply f => f a -> f b -> f a

+

apFirst :: Apply f => f a -⁠> f b -⁠> f a

Curried version of [`Z.apFirst`][]. Combines two effectful actions, keeping only the result of the first. Equivalent to Haskell's `(<*)` @@ -616,7 +616,7 @@ See also [`apSecond`](#apSecond). Just(1) ``` -

apSecond :: Apply f => f a -> f b -> f b

+

apSecond :: Apply f => f a -⁠> f b -⁠> f b

Curried version of [`Z.apSecond`][]. Combines two effectful actions, keeping only the result of the second. Equivalent to Haskell's `(*>)` @@ -632,7 +632,7 @@ See also [`apFirst`](#apFirst). Just(2) ``` -

of :: Applicative f => TypeRep f -> a -> f a

+

of :: Applicative f => TypeRep f -⁠> a -⁠> f a

Curried version of [`Z.of`][]. @@ -650,7 +650,7 @@ Just(42) Right(42) ``` -

chain :: Chain m => (a -> m b) -> m a -> m b

+

chain :: Chain m => (a -⁠> m b) -⁠> m a -⁠> m b

Curried version of [`Z.chain`][]. @@ -668,7 +668,7 @@ Just(123) Nothing ``` -

join :: Chain m => m (m a) -> m a

+

join :: Chain m => m (m a) -⁠> m a

[Type-safe][sanctuary-def] version of [`Z.join`][]. Removes one level of nesting from a nested monadic structure. @@ -696,7 +696,7 @@ from combinatory logic: 'abcabc' ``` -

chainRec :: ChainRec m => TypeRep m -> (a -> m (Either a b)) -> a -> m b

+

chainRec :: ChainRec m => TypeRep m -⁠> (a -⁠> m (Either a b)) -⁠> a -⁠> m b

Performs a [`chain`](#chain)-like computation with constant stack usage. Similar to [`Z.chainRec`][], but curried and more convenient due to the @@ -710,7 +710,7 @@ use of the Either type to indicate completion (via a Right). ['oo!', 'oo?', 'on!', 'on?', 'no!', 'no?', 'nn!', 'nn?'] ``` -

extend :: Extend w => (w a -> b) -> w a -> w b

+

extend :: Extend w => (w a -⁠> b) -⁠> w a -⁠> w b

Curried version of [`Z.extend`][]. @@ -719,11 +719,11 @@ Curried version of [`Z.extend`][]. [4] ``` -

extract :: Comonad w => w a -> a

+

extract :: Comonad w => w a -⁠> a

[Type-safe][sanctuary-def] version of [`Z.extract`][]. -

filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean) -> f a -> f a

+

filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -⁠> Boolean) -⁠> f a -⁠> f a

Curried version of [`Z.filter`][]. @@ -740,7 +740,7 @@ Just(9) Nothing ``` -

filterM :: (Monad m, Monoid (m a)) => (a -> Boolean) -> m a -> m a

+

filterM :: (Monad m, Monoid (m a)) => (a -⁠> Boolean) -⁠> m a -⁠> m a

Curried version of [`Z.filterM`][]. @@ -759,7 +759,7 @@ Nothing ### Combinator -

I :: a -> a

+

I :: a -⁠> a

The I combinator. Returns its argument. Equivalent to Haskell's `id` function. @@ -769,7 +769,7 @@ function. 'foo' ``` -

K :: a -> b -> a

+

K :: a -⁠> b -⁠> a

The K combinator. Takes two values and returns the first. Equivalent to Haskell's `const` function. @@ -782,7 +782,7 @@ Haskell's `const` function. [42, 42, 42, 42, 42] ``` -

A :: (a -> b) -> a -> b

+

A :: (a -⁠> b) -⁠> a -⁠> b

The A combinator. Takes a function and a value, and returns the result of applying the function to the value. Equivalent to Haskell's `($)` @@ -796,7 +796,7 @@ function. [101, 10] ``` -

T :: a -> (a -> b) -> b

+

T :: a -⁠> (a -⁠> b) -⁠> b

The T ([thrush][]) combinator. Takes a value and a function, and returns the result of applying the function to the value. Equivalent to Haskell's @@ -812,7 +812,7 @@ the result of applying the function to the value. Equivalent to Haskell's ### Function -

curry2 :: ((a, b) -> c) -> a -> b -> c

+

curry2 :: ((a, b) -⁠> c) -⁠> a -⁠> b -⁠> c

Curries the given binary function. @@ -824,7 +824,7 @@ Curries the given binary function. [10, 100, 1000] ``` -

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d

+

curry3 :: ((a, b, c) -⁠> d) -⁠> a -⁠> b -⁠> c -⁠> d

Curries the given ternary function. @@ -841,7 +841,7 @@ replaceString 'orange icecream' ``` -

curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e

+

curry4 :: ((a, b, c, d) -⁠> e) -⁠> a -⁠> b -⁠> c -⁠> d -⁠> e

Curries the given quaternary function. @@ -858,7 +858,7 @@ createRect {x: 0, y: 0, width: 10, height: 10} ``` -

curry5 :: ((a, b, c, d, e) -> f) -> a -> b -> c -> d -> e -> f

+

curry5 :: ((a, b, c, d, e) -⁠> f) -⁠> a -⁠> b -⁠> c -⁠> d -⁠> e -⁠> f

Curries the given quinary function. @@ -879,7 +879,7 @@ toUrl 'https://example.com:443/foo/bar' ``` -

flip :: (a -> b -> c) -> b -> a -> c

+

flip :: (a -⁠> b -⁠> c) -⁠> b -⁠> a -⁠> c

Takes a curried binary function and two values, and returns the result of applying the function to the values in reverse order. @@ -891,13 +891,13 @@ This is the C combinator from combinatory logic. 'barfoo' ``` -

flip_ :: ((a, b) -> c) -> b -> a -> c

+

flip_ :: ((a, b) -⁠> c) -⁠> b -⁠> a -⁠> c

Variant of [`flip`](#flip) which takes an uncurried binary function. ### Composition -

compose :: (b -> c) -> (a -> b) -> a -> c

+

compose :: (b -⁠> c) -⁠> (a -⁠> b) -⁠> a -⁠> c

Composes two unary functions, from right to left. Equivalent to Haskell's `(.)` function. @@ -911,7 +911,7 @@ See also [`pipe`](#pipe). 10 ``` -

pipe :: [(a -> b), (b -> c), ..., (m -> n)] -> a -> n

+

pipe :: [(a -⁠> b), (b -⁠> c), ..., (m -⁠> n)] -⁠> a -⁠> n

Takes an array of functions assumed to be unary and a value of any type, and returns the result of applying the sequence of transformations to @@ -925,7 +925,7 @@ of functions. `pipe([f, g, h], x)` is equivalent to `h(g(f(x)))`. 9 ``` -

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c

+

on :: (b -⁠> b -⁠> c) -⁠> (a -⁠> b) -⁠> a -⁠> a -⁠> c

Takes a binary function `f`, a unary function `g`, and two values `x` and `y`. Returns `f(g(x))(g(y))`. @@ -937,7 +937,7 @@ See also [`on_`](#on_). [3, 2, 1, 6, 5, 4] ``` -

on_ :: ((b, b) -> c) -> (a -> b) -> a -> a -> c

+

on_ :: ((b, b) -⁠> c) -⁠> (a -⁠> b) -⁠> a -⁠> a -⁠> c

Variant of [`on`](#on) which takes an uncurried binary function. @@ -949,15 +949,15 @@ either a Just whose value is of type `a` or Nothing (with no value). The Maybe type satisfies the [Setoid][], [Monoid][], [Monad][], [Alternative][], [Traversable][], and [Extend][] specifications. -

MaybeType :: Type -> Type

+

MaybeType :: Type -⁠> Type

A [`UnaryType`][UnaryType] for use with [sanctuary-def][]. -

Maybe :: TypeRep Maybe

+

Maybe :: TypeRep Maybe

The [type representative](#type-representatives) for the Maybe type. -

Nothing :: Maybe a

+

Nothing :: Maybe a

Nothing. @@ -966,7 +966,7 @@ Nothing. Nothing ``` -

Just :: a -> Maybe a

+

Just :: a -⁠> Maybe a

Takes a value of any type and returns a Just with the given value. @@ -975,11 +975,11 @@ Takes a value of any type and returns a Just with the given value. Just(42) ``` -

Maybe.@@type :: String

+

Maybe.@@type :: String

Maybe type identifier, `'sanctuary/Maybe'`. -

Maybe.fantasy-land/empty :: () -> Maybe a

+

Maybe.fantasy-land/empty :: () -⁠> Maybe a

Returns Nothing. @@ -988,7 +988,7 @@ Returns Nothing. Nothing ``` -

Maybe.fantasy-land/of :: a -> Maybe a

+

Maybe.fantasy-land/of :: a -⁠> Maybe a

Takes a value of any type and returns a Just with the given value. @@ -997,7 +997,7 @@ Takes a value of any type and returns a Just with the given value. Just(42) ``` -

Maybe.fantasy-land/zero :: () -> Maybe a

+

Maybe.fantasy-land/zero :: () -⁠> Maybe a

Returns Nothing. @@ -1006,7 +1006,7 @@ Returns Nothing. Nothing ``` -

Maybe#isNothing :: Maybe a ~> Boolean

+

Maybe#isNothing :: Maybe a ~> Boolean

`true` if `this` is Nothing; `false` if `this` is a Just. @@ -1018,7 +1018,7 @@ true false ``` -

Maybe#isJust :: Maybe a ~> Boolean

+

Maybe#isJust :: Maybe a ~> Boolean

`true` if `this` is a Just; `false` if `this` is Nothing. @@ -1030,7 +1030,7 @@ true false ``` -

Maybe#toString :: Maybe a ~> () -> String

+

Maybe#toString :: Maybe a ~> () -⁠> String

Returns the string representation of the Maybe. @@ -1042,7 +1042,7 @@ Returns the string representation of the Maybe. 'Just([1, 2, 3])' ``` -

Maybe#inspect :: Maybe a ~> () -> String

+

Maybe#inspect :: Maybe a ~> () -⁠> String

Returns the string representation of the Maybe. This method is used by `util.inspect` and the REPL to format a Maybe for display. @@ -1057,7 +1057,7 @@ See also [`Maybe#toString`][]. 'Just([1, 2, 3])' ``` -

Maybe#fantasy-land/equals :: Maybe a ~> Maybe a -> Boolean

+

Maybe#fantasy-land/equals :: Maybe a ~> Maybe a -⁠> Boolean

Takes a value of the same type and returns `true` if: @@ -1080,7 +1080,7 @@ false false ``` -

Maybe#fantasy-land/concat :: Semigroup a => Maybe a ~> Maybe a -> Maybe a

+

Maybe#fantasy-land/concat :: Semigroup a => Maybe a ~> Maybe a -⁠> Maybe a

Returns the result of concatenating two Maybe values of the same type. `a` must have a [Semigroup][]. @@ -1108,7 +1108,7 @@ Just([1, 2, 3]) Just([1, 2, 3]) ``` -

Maybe#fantasy-land/map :: Maybe a ~> (a -> b) -> Maybe b

+

Maybe#fantasy-land/map :: Maybe a ~> (a -⁠> b) -⁠> Maybe b

Takes a function and returns `this` if `this` is Nothing; otherwise it returns a Just whose value is the result of applying the function @@ -1122,7 +1122,7 @@ Nothing Just(3) ``` -

Maybe#fantasy-land/ap :: Maybe a ~> Maybe (a -> b) -> Maybe b

+

Maybe#fantasy-land/ap :: Maybe a ~> Maybe (a -⁠> b) -⁠> Maybe b

Takes a Maybe and returns Nothing unless `this` is a Just *and* the argument is a Just, in which case it returns a Just whose value is @@ -1142,7 +1142,7 @@ Nothing Just(3) ``` -

Maybe#fantasy-land/chain :: Maybe a ~> (a -> Maybe b) -> Maybe b

+

Maybe#fantasy-land/chain :: Maybe a ~> (a -⁠> Maybe b) -⁠> Maybe b

Takes a function and returns `this` if `this` is Nothing; otherwise it returns the result of applying the function to this Just's value. @@ -1158,7 +1158,7 @@ Nothing Just(12.34) ``` -

Maybe#fantasy-land/alt :: Maybe a ~> Maybe a -> Maybe a

+

Maybe#fantasy-land/alt :: Maybe a ~> Maybe a -⁠> Maybe a

Chooses between `this` and the other Maybe provided as an argument. Returns `this` if `this` is a Just; the other Maybe otherwise. @@ -1177,7 +1177,7 @@ Just(2) Just(3) ``` -

Maybe#fantasy-land/reduce :: Maybe a ~> ((b, a) -> b, b) -> b

+

Maybe#fantasy-land/reduce :: Maybe a ~> ((b, a) -⁠> b, b) -⁠> b

Takes a function and an initial value of any type, and returns: @@ -1194,7 +1194,7 @@ Takes a function and an initial value of any type, and returns: 1000 ``` -

Maybe#fantasy-land/traverse :: Applicative f => Maybe a ~> (TypeRep f, a -> f b) -> f (Maybe b)

+

Maybe#fantasy-land/traverse :: Applicative f => Maybe a ~> (TypeRep f, a -⁠> f b) -⁠> f (Maybe b)

Takes two functions which both return values of the same [Applicative][], (the second of which must be that type's [`of`][] function) and returns: @@ -1212,7 +1212,7 @@ Takes two functions which both return values of the same [Applicative][], [Just('foo'), Just('bar'), Just('baz')] ``` -

Maybe#fantasy-land/extend :: Maybe a ~> (Maybe a -> b) -> Maybe b

+

Maybe#fantasy-land/extend :: Maybe a ~> (Maybe a -⁠> b) -⁠> Maybe b

Takes a function and returns `this` if `this` is Nothing; otherwise it returns a Just whose value is the result of applying the function @@ -1226,7 +1226,7 @@ Nothing Just(43) ``` -

isNothing :: Maybe a -> Boolean

+

isNothing :: Maybe a -⁠> Boolean

Returns `true` if the given Maybe is Nothing; `false` if it is a Just. @@ -1238,7 +1238,7 @@ true false ``` -

isJust :: Maybe a -> Boolean

+

isJust :: Maybe a -⁠> Boolean

Returns `true` if the given Maybe is a Just; `false` if it is Nothing. @@ -1250,7 +1250,7 @@ true false ``` -

fromMaybe :: a -> Maybe a -> a

+

fromMaybe :: a -⁠> Maybe a -⁠> a

Takes a default value and a Maybe, and returns the Maybe's value if the Maybe is a Just; the default value otherwise. @@ -1266,7 +1266,7 @@ See also [`fromMaybe_`](#fromMaybe_) and 0 ``` -

fromMaybe_ :: (() -> a) -> Maybe a -> a

+

fromMaybe_ :: (() -⁠> a) -⁠> Maybe a -⁠> a

Variant of [`fromMaybe`](#fromMaybe) which takes a thunk so the default value is only computed if required. @@ -1281,7 +1281,7 @@ value is only computed if required. 832040 ``` -

maybeToNullable :: Maybe a -> Nullable a

+

maybeToNullable :: Maybe a -⁠> Nullable a

Returns the given Maybe's value if the Maybe is a Just; `null` otherwise. [Nullable][] is defined in [sanctuary-def][]. @@ -1296,7 +1296,7 @@ See also [`fromMaybe`](#fromMaybe). null ``` -

toMaybe :: a? -> Maybe a

+

toMaybe :: a? -⁠> Maybe a

Takes a value and returns Nothing if the value is `null` or `undefined`; Just the value otherwise. @@ -1309,7 +1309,7 @@ Nothing Just(42) ``` -

maybe :: b -> (a -> b) -> Maybe a -> b

+

maybe :: b -⁠> (a -⁠> b) -⁠> Maybe a -⁠> b

Takes a value of any type, a function, and a Maybe. If the Maybe is a Just, the return value is the result of applying the function to @@ -1325,7 +1325,7 @@ See also [`maybe_`](#maybe_). 0 ``` -

maybe_ :: (() -> b) -> (a -> b) -> Maybe a -> b

+

maybe_ :: (() -⁠> b) -⁠> (a -⁠> b) -⁠> Maybe a -⁠> b

Variant of [`maybe`](#maybe) which takes a thunk so the default value is only computed if required. @@ -1340,7 +1340,7 @@ is only computed if required. 832040 ``` -

justs :: Array (Maybe a) -> Array a

+

justs :: Array (Maybe a) -⁠> Array a

Takes an array of Maybes and returns an array containing each Just's value. Equivalent to Haskell's `catMaybes` function. @@ -1352,7 +1352,7 @@ See also [`lefts`](#lefts) and [`rights`](#rights). ['foo', 'baz'] ``` -

mapMaybe :: (a -> Maybe b) -> Array a -> Array b

+

mapMaybe :: (a -⁠> Maybe b) -⁠> Array a -⁠> Array b

Takes a function and an array, applies the function to each element of the array, and returns an array of "successful" results. If the result of @@ -1367,7 +1367,7 @@ In general terms, `mapMaybe` filters an array while mapping over it. [1, 4] ``` -

encase :: (a -> b) -> a -> Maybe b

+

encase :: (a -⁠> b) -⁠> a -⁠> Maybe b

Takes a unary function `f` which may throw and a value `x` of any type, and applies `f` to `x` inside a `try` block. If an exception is caught, @@ -1384,29 +1384,29 @@ Just(2) Nothing ``` -

encase2 :: (a -> b -> c) -> a -> b -> Maybe c

+

encase2 :: (a -⁠> b -⁠> c) -⁠> a -⁠> b -⁠> Maybe c

Binary version of [`encase`](#encase). See also [`encase2_`](#encase2_). -

encase2_ :: ((a, b) -> c) -> a -> b -> Maybe c

+

encase2_ :: ((a, b) -⁠> c) -⁠> a -⁠> b -⁠> Maybe c

Variant of [`encase2`](#encase2) which takes an uncurried binary function. -

encase3 :: (a -> b -> c -> d) -> a -> b -> c -> Maybe d

+

encase3 :: (a -⁠> b -⁠> c -⁠> d) -⁠> a -⁠> b -⁠> c -⁠> Maybe d

Ternary version of [`encase`](#encase). See also [`encase3_`](#encase3_). -

encase3_ :: ((a, b, c) -> d) -> a -> b -> c -> Maybe d

+

encase3_ :: ((a, b, c) -⁠> d) -⁠> a -⁠> b -⁠> c -⁠> Maybe d

Variant of [`encase3`](#encase3) which takes an uncurried ternary function. -

maybeToEither :: a -> Maybe b -> Either a b

+

maybeToEither :: a -⁠> Maybe b -⁠> Either a b

Converts a Maybe to an Either. Nothing becomes a Left (containing the first argument); a Just becomes a Right. @@ -1430,15 +1430,15 @@ value is of type `b`. The Either type satisfies the [Setoid][], [Semigroup][], [Monad][], [Alt][], [Traversable][], [Extend][], and [Bifunctor][] specifications. -

EitherType :: Type -> Type -> Type

+

EitherType :: Type -⁠> Type -⁠> Type

A [`BinaryType`][BinaryType] for use with [sanctuary-def][]. -

Either :: TypeRep Either

+

Either :: TypeRep Either

The [type representative](#type-representatives) for the Either type. -

Left :: a -> Either a b

+

Left :: a -⁠> Either a b

Takes a value of any type and returns a Left with the given value. @@ -1447,7 +1447,7 @@ Takes a value of any type and returns a Left with the given value. Left('Cannot divide by zero') ``` -

Right :: b -> Either a b

+

Right :: b -⁠> Either a b

Takes a value of any type and returns a Right with the given value. @@ -1456,11 +1456,11 @@ Takes a value of any type and returns a Right with the given value. Right(42) ``` -

Either.@@type :: String

+

Either.@@type :: String

Either type identifier, `'sanctuary/Either'`. -

Either.fantasy-land/of :: b -> Either a b

+

Either.fantasy-land/of :: b -⁠> Either a b

Takes a value of any type and returns a Right with the given value. @@ -1469,7 +1469,7 @@ Takes a value of any type and returns a Right with the given value. Right(42) ``` -

Either#isLeft :: Either a b ~> Boolean

+

Either#isLeft :: Either a b ~> Boolean

`true` if `this` is a Left; `false` if `this` is a Right. @@ -1481,7 +1481,7 @@ true false ``` -

Either#isRight :: Either a b ~> Boolean

+

Either#isRight :: Either a b ~> Boolean

`true` if `this` is a Right; `false` if `this` is a Left. @@ -1493,7 +1493,7 @@ true false ``` -

Either#toString :: Either a b ~> () -> String

+

Either#toString :: Either a b ~> () -⁠> String

Returns the string representation of the Either. @@ -1505,7 +1505,7 @@ Returns the string representation of the Either. 'Right([1, 2, 3])' ``` -

Either#inspect :: Either a b ~> () -> String

+

Either#inspect :: Either a b ~> () -⁠> String

Returns the string representation of the Either. This method is used by `util.inspect` and the REPL to format a Either for display. @@ -1520,7 +1520,7 @@ See also [`Either#toString`][]. 'Right([1, 2, 3])' ``` -

Either#fantasy-land/equals :: Either a b ~> Either a b -> Boolean

+

Either#fantasy-land/equals :: Either a b ~> Either a b -⁠> Boolean

Takes a value of the same type and returns `true` if: @@ -1538,7 +1538,7 @@ true false ``` -

Either#fantasy-land/concat :: (Semigroup a, Semigroup b) => Either a b ~> Either a b -> Either a b

+

Either#fantasy-land/concat :: (Semigroup a, Semigroup b) => Either a b ~> Either a b -⁠> Either a b

Returns the result of concatenating two Either values of the same type. `a` must have a [Semigroup][], as must `b`. @@ -1567,7 +1567,7 @@ Right([1, 2, 3]) Right([1, 2, 3]) ``` -

Either#fantasy-land/map :: Either a b ~> (b -> c) -> Either a c

+

Either#fantasy-land/map :: Either a b ~> (b -⁠> c) -⁠> Either a c

Takes a function and returns `this` if `this` is a Left; otherwise it returns a Right whose value is the result of applying the function to @@ -1583,7 +1583,7 @@ Left('Cannot divide by zero') Right(3) ``` -

Either#fantasy-land/bimap :: Either a b ~> (a -> c, b -> d) -> Either c d

+

Either#fantasy-land/bimap :: Either a b ~> (a -⁠> c, b -⁠> d) -⁠> Either c d

Takes two functions and returns: @@ -1604,7 +1604,7 @@ Left('ABC') Right(43) ``` -

Either#fantasy-land/ap :: Either a b ~> Either a (b -> c) -> Either a c

+

Either#fantasy-land/ap :: Either a b ~> Either a (b -⁠> c) -⁠> Either a c

Takes an Either and returns a Left unless `this` is a Right *and* the argument is a Right, in which case it returns a Right whose value is @@ -1624,7 +1624,7 @@ Left('Cannot divide by zero') Right(3) ``` -

Either#fantasy-land/chain :: Either a b ~> (b -> Either a c) -> Either a c

+

Either#fantasy-land/chain :: Either a b ~> (b -⁠> Either a c) -⁠> Either a c

Takes a function and returns `this` if `this` is a Left; otherwise it returns the result of applying the function to this Right's value. @@ -1645,7 +1645,7 @@ Left('Cannot represent square root of negative number') Right(5) ``` -

Either#fantasy-land/alt :: Either a b ~> Either a b -> Either a b

+

Either#fantasy-land/alt :: Either a b ~> Either a b -⁠> Either a b

Chooses between `this` and the other Either provided as an argument. Returns `this` if `this` is a Right; the other Either otherwise. @@ -1664,7 +1664,7 @@ Right(2) Right(3) ``` -

Either#fantasy-land/reduce :: Either a b ~> ((c, b) -> c, c) -> c

+

Either#fantasy-land/reduce :: Either a b ~> ((c, b) -⁠> c, c) -⁠> c

Takes a function and an initial value of any type, and returns: @@ -1681,7 +1681,7 @@ Takes a function and an initial value of any type, and returns: 1000 ``` -

Either#fantasy-land/traverse :: Applicative f => Either a b ~> (TypeRep f, b -> f c) -> f (Either a c)

+

Either#fantasy-land/traverse :: Applicative f => Either a b ~> (TypeRep f, b -⁠> f c) -⁠> f (Either a c)

Takes two functions which both return values of the same [Applicative][], (the second of which must be that type's [`of`][] function) and returns: @@ -1699,7 +1699,7 @@ Takes two functions which both return values of the same [Applicative][], [Right('foo'), Right('bar'), Right('baz')] ``` -

Either#fantasy-land/extend :: Either a b ~> (Either a b -> c) -> Either a c

+

Either#fantasy-land/extend :: Either a b ~> (Either a b -⁠> c) -⁠> Either a c

Takes a function and returns `this` if `this` is a Left; otherwise it returns a Right whose value is the result of applying the function to @@ -1713,7 +1713,7 @@ Left('Cannot divide by zero') Right(43) ``` -

isLeft :: Either a b -> Boolean

+

isLeft :: Either a b -⁠> Boolean

Returns `true` if the given Either is a Left; `false` if it is a Right. @@ -1725,7 +1725,7 @@ true false ``` -

isRight :: Either a b -> Boolean

+

isRight :: Either a b -⁠> Boolean

Returns `true` if the given Either is a Right; `false` if it is a Left. @@ -1737,7 +1737,7 @@ true false ``` -

fromEither :: b -> Either a b -> b

+

fromEither :: b -⁠> Either a b -⁠> b

Takes a default value and an Either, and returns the Right value if the Either is a Right; the default value otherwise. @@ -1750,7 +1750,7 @@ if the Either is a Right; the default value otherwise. 0 ``` -

toEither :: a -> b? -> Either a b

+

toEither :: a -⁠> b? -⁠> Either a b

Converts an arbitrary value to an Either: a Left if the value is `null` or `undefined`; a Right otherwise. The first argument specifies the @@ -1770,7 +1770,7 @@ Left('Invalid protocol') Right('https:') ``` -

either :: (a -> c) -> (b -> c) -> Either a b -> c

+

either :: (a -⁠> c) -⁠> (b -⁠> c) -⁠> Either a b -⁠> c

Takes two functions and an Either, and returns the result of applying the first function to the Left's value, if the Either @@ -1785,7 +1785,7 @@ Right's value, if the Either is a Right. '42' ``` -

lefts :: Array (Either a b) -> Array a

+

lefts :: Array (Either a b) -⁠> Array a

Takes an array of Eithers and returns an array containing each Left's value. @@ -1797,7 +1797,7 @@ See also [`rights`](#rights). ['foo', 'bar'] ``` -

rights :: Array (Either a b) -> Array b

+

rights :: Array (Either a b) -⁠> Array b

Takes an array of Eithers and returns an array containing each Right's value. @@ -1809,7 +1809,7 @@ See also [`lefts`](#lefts). [20, 10] ``` -

encaseEither :: (Error -> l) -> (a -> r) -> a -> Either l r

+

encaseEither :: (Error -⁠> l) -⁠> (a -⁠> r) -⁠> a -⁠> Either l r

Takes two unary functions, `f` and `g`, the second of which may throw, and a value `x` of any type. Applies `g` to `x` inside a `try` block. @@ -1830,29 +1830,29 @@ Left(new SyntaxError('Unexpected end of JSON input')) Left('Unexpected end of JSON input') ``` -

encaseEither2 :: (Error -> l) -> (a -> b -> r) -> a -> b -> Either l r

+

encaseEither2 :: (Error -⁠> l) -⁠> (a -⁠> b -⁠> r) -⁠> a -⁠> b -⁠> Either l r

Binary version of [`encaseEither`](#encaseEither). See also [`encaseEither2_`](#encaseEither2_). -

encaseEither2_ :: (Error -> l) -> ((a, b) -> r) -> a -> b -> Either l r

+

encaseEither2_ :: (Error -⁠> l) -⁠> ((a, b) -⁠> r) -⁠> a -⁠> b -⁠> Either l r

Variant of [`encaseEither2`](#encaseEither2) which takes an uncurried binary function. -

encaseEither3 :: (Error -> l) -> (a -> b -> c -> r) -> a -> b -> c -> Either l r

+

encaseEither3 :: (Error -⁠> l) -⁠> (a -⁠> b -⁠> c -⁠> r) -⁠> a -⁠> b -⁠> c -⁠> Either l r

Ternary version of [`encaseEither`](#encaseEither). See also [`encaseEither3_`](#encaseEither3_). -

encaseEither3_ :: (Error -> l) -> ((a, b, c) -> r) -> a -> b -> c -> Either l r

+

encaseEither3_ :: (Error -⁠> l) -⁠> ((a, b, c) -⁠> r) -⁠> a -⁠> b -⁠> c -⁠> Either l r

Variant of [`encaseEither3`](#encaseEither3) which takes an uncurried ternary function. -

eitherToMaybe :: Either a b -> Maybe b

+

eitherToMaybe :: Either a b -⁠> Maybe b

Converts an Either to a Maybe. A Left becomes Nothing; a Right becomes a Just. @@ -1869,7 +1869,7 @@ Just(42) ### Logic -

and :: Boolean -> Boolean -> Boolean

+

and :: Boolean -⁠> Boolean -⁠> Boolean

Boolean "and". @@ -1887,7 +1887,7 @@ false true ``` -

or :: Boolean -> Boolean -> Boolean

+

or :: Boolean -⁠> Boolean -⁠> Boolean

Boolean "or". @@ -1905,7 +1905,7 @@ true true ``` -

not :: Boolean -> Boolean

+

not :: Boolean -⁠> Boolean

Boolean "not". @@ -1917,7 +1917,7 @@ true false ``` -

ifElse :: (a -> Boolean) -> (a -> b) -> (a -> b) -> a -> b

+

ifElse :: (a -⁠> Boolean) -⁠> (a -⁠> b) -⁠> (a -⁠> b) -⁠> a -⁠> b

Takes a unary predicate, a unary "if" function, a unary "else" function, and a value of any type, and returns the result of @@ -1933,7 +1933,7 @@ value otherwise. 4 ``` -

allPass :: Array (a -> Boolean) -> a -> Boolean

+

allPass :: Array (a -⁠> Boolean) -⁠> a -⁠> Boolean

Takes an array of unary predicates and a value of any type and returns `true` if all the predicates pass; `false` otherwise. @@ -1948,7 +1948,7 @@ true false ``` -

anyPass :: Array (a -> Boolean) -> a -> Boolean

+

anyPass :: Array (a -⁠> Boolean) -⁠> a -⁠> Boolean

Takes an array of unary predicates and a value of any type and returns `true` if any of the predicates pass; `false` otherwise. @@ -1995,7 +1995,7 @@ replaced with the latter: It's then apparent that the first argument needn't be a single-character string; the correspondence between arrays and strings does not hold. -

concat :: Semigroup a => a -> a -> a

+

concat :: Semigroup a => a -⁠> a -⁠> a

Concatenates two (homogeneous) arrays, two strings, or two values of any other type which satisfies the [Semigroup][] specification. @@ -2011,7 +2011,7 @@ other type which satisfies the [Semigroup][] specification. Just('foobar') ``` -

slice :: Integer -> Integer -> List a -> Maybe (List a)

+

slice :: Integer -⁠> Integer -⁠> List a -⁠> Maybe (List a)

Returns Just a list containing the elements from the supplied list from a beginning index (inclusive) to an end index (exclusive). @@ -2037,7 +2037,7 @@ Nothing Just('nana') ``` -

at :: Integer -> List a -> Maybe a

+

at :: Integer -⁠> List a -⁠> Maybe a

Takes an index and a list and returns Just the element of the list at the index if the index is within the list's bounds; Nothing otherwise. @@ -2054,7 +2054,7 @@ Nothing Just('d') ``` -

head :: List a -> Maybe a

+

head :: List a -⁠> Maybe a

Takes a list and returns Just the first element of the list if the list contains at least one element; Nothing if the list is empty. @@ -2067,7 +2067,7 @@ Just(1) Nothing ``` -

last :: List a -> Maybe a

+

last :: List a -⁠> Maybe a

Takes a list and returns Just the last element of the list if the list contains at least one element; Nothing if the list is empty. @@ -2080,7 +2080,7 @@ Just(3) Nothing ``` -

tail :: List a -> Maybe (List a)

+

tail :: List a -⁠> Maybe (List a)

Takes a list and returns Just a list containing all but the first of the list's elements if the list contains at least one element; @@ -2094,7 +2094,7 @@ Just([2, 3]) Nothing ``` -

init :: List a -> Maybe (List a)

+

init :: List a -⁠> Maybe (List a)

Takes a list and returns Just a list containing all but the last of the list's elements if the list contains at least one element; @@ -2108,7 +2108,7 @@ Just([1, 2]) Nothing ``` -

take :: Integer -> List a -> Maybe (List a)

+

take :: Integer -⁠> List a -⁠> Maybe (List a)

Returns Just the first N elements of the given collection if N is greater than or equal to zero and less than or equal to the length @@ -2125,7 +2125,7 @@ Just('abcd') Nothing ``` -

takeLast :: Integer -> List a -> Maybe (List a)

+

takeLast :: Integer -⁠> List a -⁠> Maybe (List a)

Returns Just the last N elements of the given collection if N is greater than or equal to zero and less than or equal to the length @@ -2142,7 +2142,7 @@ Just('defg') Nothing ``` -

drop :: Integer -> List a -> Maybe (List a)

+

drop :: Integer -⁠> List a -⁠> Maybe (List a)

Returns Just all but the first N elements of the given collection if N is greater than or equal to zero and less than or equal to the @@ -2159,7 +2159,7 @@ Just('efg') Nothing ``` -

dropLast :: Integer -> List a -> Maybe (List a)

+

dropLast :: Integer -⁠> List a -⁠> Maybe (List a)

Returns Just all but the last N elements of the given collection if N is greater than or equal to zero and less than or equal to the @@ -2176,7 +2176,7 @@ Just('abc') Nothing ``` -

reverse :: List a -> List a

+

reverse :: List a -⁠> List a

Returns the elements of the given list in reverse order. @@ -2188,7 +2188,7 @@ Returns the elements of the given list in reverse order. 'cba' ``` -

indexOf :: a -> List a -> Maybe Integer

+

indexOf :: a -⁠> List a -⁠> Maybe Integer

Takes a value of any type and a list, and returns Just the index of the first occurrence of the value in the list, if applicable; @@ -2208,7 +2208,7 @@ Just(1) Nothing ``` -

lastIndexOf :: a -> List a -> Maybe Integer

+

lastIndexOf :: a -⁠> List a -⁠> Maybe Integer

Takes a value of any type and a list, and returns Just the index of the last occurrence of the value in the list, if applicable; @@ -2230,7 +2230,7 @@ Nothing ### Array -

append :: a -> Array a -> Array a

+

append :: a -⁠> Array a -⁠> Array a

Takes a value of any type and an array of values of that type, and returns the result of appending the value to the array. @@ -2242,7 +2242,7 @@ See also [`prepend`](#prepend). [1, 2, 3] ``` -

prepend :: a -> Array a -> Array a

+

prepend :: a -⁠> Array a -⁠> Array a

Takes a value of any type and an array of values of that type, and returns the result of prepending the value to the array. @@ -2254,7 +2254,7 @@ See also [`append`](#append). [1, 2, 3] ``` -

joinWith :: String -> Array String -> String

+

joinWith :: String -⁠> Array String -⁠> String

Joins the strings of the second argument separated by the first argument. @@ -2269,7 +2269,7 @@ See also [`splitOn`](#splitOn). 'foo:bar:baz' ``` -

find :: (a -> Boolean) -> Array a -> Maybe a

+

find :: (a -⁠> Boolean) -⁠> Array a -⁠> Maybe a

Takes a predicate and an array and returns Just the leftmost element of the array which satisfies the predicate; Nothing if none of the array's @@ -2283,7 +2283,7 @@ Just(-2) Nothing ``` -

pluck :: Accessible a => String -> Array a -> Array b

+

pluck :: Accessible a => String -⁠> Array a -⁠> Array b

Combines [`map`](#map) and [`prop`](#prop). `pluck(k, xs)` is equivalent to `map(prop(k), xs)`. @@ -2293,7 +2293,7 @@ to `map(prop(k), xs)`. [1, 2, 3] ``` -

unfoldr :: (b -> Maybe (Pair a b)) -> b -> Array a

+

unfoldr :: (b -⁠> Maybe (Pair a b)) -⁠> b -⁠> Array a

Takes a function and a seed value, and returns an array generated by applying the function repeatedly. The array is initially empty. The @@ -2310,7 +2310,7 @@ of the function should result in either: [1, 2, 3, 4] ``` -

range :: Integer -> Integer -> Array Integer

+

range :: Integer -⁠> Integer -⁠> Array Integer

Returns an array of consecutive integers starting with the first argument and ending with the second argument minus one. Returns `[]` if the second @@ -2329,7 +2329,7 @@ argument is less than or equal to the first argument. ### Object -

prop :: Accessible a => String -> a -> b

+

prop :: Accessible a => String -⁠> a -⁠> b

Takes a property name and an object with known properties and returns the value of the specified property. If for some reason the object @@ -2344,7 +2344,7 @@ See also [`pluck`](#pluck). 1 ``` -

props :: Accessible a => Array String -> a -> b

+

props :: Accessible a => Array String -⁠> a -⁠> b

Takes a property path (an array of property names) and an object with known structure and returns the value at the given path. If for some @@ -2358,7 +2358,7 @@ instead. 1 ``` -

get :: Accessible a => (b -> Boolean) -> String -> a -> Maybe c

+

get :: Accessible a => (b -⁠> Boolean) -⁠> String -⁠> a -⁠> Maybe c

Takes a predicate, a property name, and an object and returns Just the value of the specified object property if it exists and the value @@ -2377,7 +2377,7 @@ Nothing Nothing ``` -

gets :: Accessible a => (b -> Boolean) -> Array String -> a -> Maybe c

+

gets :: Accessible a => (b -⁠> Boolean) -⁠> Array String -⁠> a -⁠> Maybe c

Takes a predicate, a property path (an array of property names), and an object and returns Just the value at the given path if such a path @@ -2396,7 +2396,7 @@ Nothing Nothing ``` -

keys :: StrMap a -> Array String

+

keys :: StrMap a -⁠> Array String

Returns the keys of the given string map, in arbitrary order. @@ -2405,7 +2405,7 @@ Returns the keys of the given string map, in arbitrary order. ['a', 'b', 'c'] ``` -

values :: StrMap a -> Array a

+

values :: StrMap a -⁠> Array a

Returns the values of the given string map, in arbitrary order. @@ -2414,7 +2414,7 @@ Returns the values of the given string map, in arbitrary order. [1, 2, 3] ``` -

pairs :: StrMap a -> Array (Pair String a)

+

pairs :: StrMap a -⁠> Array (Pair String a)

Returns the key–value pairs of the given string map, in arbitrary order. @@ -2425,7 +2425,7 @@ Returns the key–value pairs of the given string map, in arbitrary order. ### Number -

negate :: ValidNumber -> ValidNumber

+

negate :: ValidNumber -⁠> ValidNumber

Negates its argument. @@ -2437,7 +2437,7 @@ Negates its argument. 42 ``` -

add :: FiniteNumber -> FiniteNumber -> FiniteNumber

+

add :: FiniteNumber -⁠> FiniteNumber -⁠> FiniteNumber

Returns the sum of two (finite) numbers. @@ -2446,7 +2446,7 @@ Returns the sum of two (finite) numbers. 2 ``` -

sum :: Foldable f => f FiniteNumber -> FiniteNumber

+

sum :: Foldable f => f FiniteNumber -⁠> FiniteNumber

Returns the sum of the given array of (finite) numbers. @@ -2464,7 +2464,7 @@ Returns the sum of the given array of (finite) numbers. 0 ``` -

sub :: FiniteNumber -> FiniteNumber -> FiniteNumber

+

sub :: FiniteNumber -⁠> FiniteNumber -⁠> FiniteNumber

Returns the difference between two (finite) numbers. @@ -2473,7 +2473,7 @@ Returns the difference between two (finite) numbers. 2 ``` -

inc :: FiniteNumber -> FiniteNumber

+

inc :: FiniteNumber -⁠> FiniteNumber

Increments a (finite) number by one. @@ -2482,7 +2482,7 @@ Increments a (finite) number by one. 2 ``` -

dec :: FiniteNumber -> FiniteNumber

+

dec :: FiniteNumber -⁠> FiniteNumber

Decrements a (finite) number by one. @@ -2491,7 +2491,7 @@ Decrements a (finite) number by one. 1 ``` -

mult :: FiniteNumber -> FiniteNumber -> FiniteNumber

+

mult :: FiniteNumber -⁠> FiniteNumber -⁠> FiniteNumber

Returns the product of two (finite) numbers. @@ -2500,7 +2500,7 @@ Returns the product of two (finite) numbers. 8 ``` -

product :: Foldable f => f FiniteNumber -> FiniteNumber

+

product :: Foldable f => f FiniteNumber -⁠> FiniteNumber

Returns the product of the given array of (finite) numbers. @@ -2518,7 +2518,7 @@ Returns the product of the given array of (finite) numbers. 1 ``` -

div :: FiniteNumber -> NonZeroFiniteNumber -> FiniteNumber

+

div :: FiniteNumber -⁠> NonZeroFiniteNumber -⁠> FiniteNumber

Returns the result of dividing its first argument (a finite number) by its second argument (a non-zero finite number). @@ -2528,7 +2528,7 @@ its second argument (a non-zero finite number). 3.5 ``` -

mean :: Foldable f => f FiniteNumber -> Maybe FiniteNumber

+

mean :: Foldable f => f FiniteNumber -⁠> Maybe FiniteNumber

Returns the mean of the given array of (finite) numbers. @@ -2546,7 +2546,7 @@ Just(42) Nothing ``` -

min :: Ord a => a -> a -> a

+

min :: Ord a => a -⁠> a -⁠> a

Returns the smaller of its two arguments. @@ -2567,7 +2567,7 @@ new Date('1999-12-31') '10' ``` -

max :: Ord a => a -> a -> a

+

max :: Ord a => a -⁠> a -⁠> a

Returns the larger of its two arguments. @@ -2590,7 +2590,7 @@ new Date('2000-01-01') ### Integer -

even :: Integer -> Boolean

+

even :: Integer -⁠> Boolean

Returns `true` if the given integer is even; `false` if it is odd. @@ -2602,7 +2602,7 @@ true false ``` -

odd :: Integer -> Boolean

+

odd :: Integer -⁠> Boolean

Returns `true` if the given integer is odd; `false` if it is even. @@ -2616,7 +2616,7 @@ false ### Parse -

parseDate :: String -> Maybe Date

+

parseDate :: String -⁠> Maybe Date

Takes a string and returns Just the date represented by the string if it does in fact represent a date; Nothing otherwise. @@ -2629,7 +2629,7 @@ Just(new Date('2011-01-19T17:40:00.000Z')) Nothing ``` -

parseFloat :: String -> Maybe Number

+

parseFloat :: String -⁠> Maybe Number

Takes a string and returns Just the number represented by the string if it does in fact represent a number; Nothing otherwise. @@ -2642,7 +2642,7 @@ Just(-123.45) Nothing ``` -

parseInt :: Integer -> String -> Maybe Integer

+

parseInt :: Integer -⁠> String -⁠> Maybe Integer

Takes a radix (an integer between 2 and 36 inclusive) and a string, and returns Just the number represented by the string if it does in @@ -2664,7 +2664,7 @@ Just(255) Nothing ``` -

parseJson :: (a -> Boolean) -> String -> Maybe b

+

parseJson :: (a -⁠> Boolean) -⁠> String -⁠> Maybe b

Takes a predicate and a string which may or may not be valid JSON, and returns Just the result of applying `JSON.parse` to the string *if* the @@ -2683,7 +2683,7 @@ Nothing ### RegExp -

regex :: RegexFlags -> String -> RegExp

+

regex :: RegexFlags -⁠> String -⁠> RegExp

Takes a [RegexFlags][] and a pattern, and returns a RegExp. @@ -2692,7 +2692,7 @@ Takes a [RegexFlags][] and a pattern, and returns a RegExp. /:\d+:/g ``` -

regexEscape :: String -> String

+

regexEscape :: String -⁠> String

Takes a string which may contain regular expression metacharacters, and returns a string with those metacharacters escaped. @@ -2706,7 +2706,7 @@ Properties: '\\-=\\*\\{XYZ\\}\\*=\\-' ``` -

test :: RegExp -> String -> Boolean

+

test :: RegExp -⁠> String -⁠> Boolean

Takes a pattern and a string, and returns `true` if the pattern matches the string; `false` otherwise. @@ -2719,7 +2719,7 @@ true false ``` -

match :: NonGlobalRegExp -> String -> Maybe { match :: String, groups :: Array (Maybe String) }

+

match :: NonGlobalRegExp -⁠> String -⁠> Maybe { match :: String, groups :: Array (Maybe String) }

Takes a pattern and a string, and returns Just a match record if the pattern matches the string; Nothing otherwise. @@ -2742,7 +2742,7 @@ Just({match: 'goodbye', groups: [Just('good')]}) Just({match: 'bye', groups: [Nothing]}) ``` -

matchAll :: GlobalRegExp -> String -> Array { match :: String, groups :: Array (Maybe String) }

+

matchAll :: GlobalRegExp -⁠> String -⁠> Array { match :: String, groups :: Array (Maybe String) }

Takes a pattern and a string, and returns an array of match records. @@ -2763,7 +2763,7 @@ See also [`match`](#match). ### String -

toUpper :: String -> String

+

toUpper :: String -⁠> String

Returns the upper-case equivalent of its argument. @@ -2774,7 +2774,7 @@ See also [`toLower`](#toLower). 'ABC DEF 123' ``` -

toLower :: String -> String

+

toLower :: String -⁠> String

Returns the lower-case equivalent of its argument. @@ -2785,7 +2785,7 @@ See also [`toUpper`](#toUpper). 'abc def 123' ``` -

trim :: String -> String

+

trim :: String -⁠> String

Strips leading and trailing whitespace characters. @@ -2794,7 +2794,7 @@ Strips leading and trailing whitespace characters. 'foo bar' ``` -

words :: String -> Array String

+

words :: String -⁠> Array String

Takes a string and returns the array of words the string contains (words are delimited by whitespace characters). @@ -2806,7 +2806,7 @@ See also [`unwords`](#unwords). ['foo', 'bar', 'baz'] ``` -

unwords :: Array String -> String

+

unwords :: Array String -⁠> String

Takes an array of words and returns the result of joining the words with separating spaces. @@ -2818,7 +2818,7 @@ See also [`words`](#words). 'foo bar baz' ``` -

lines :: String -> Array String

+

lines :: String -⁠> Array String

Takes a string and returns the array of lines the string contains (lines are delimited by newlines: `'\n'` or `'\r\n'` or `'\r'`). @@ -2831,7 +2831,7 @@ See also [`unlines`](#unlines). ['foo', 'bar', 'baz'] ``` -

unlines :: Array String -> String

+

unlines :: Array String -⁠> String

Takes an array of lines and returns the result of joining the lines after appending a terminating line feed (`'\n'`) to each. @@ -2843,7 +2843,7 @@ See also [`lines`](#lines). 'foo\nbar\nbaz\n' ``` -

splitOn :: String -> String -> Array String

+

splitOn :: String -⁠> String -⁠> Array String

Returns the substrings of its second argument separated by occurrences of its first argument. diff --git a/index.js b/index.js index db96cf12..0f6fc9a9 100644 --- a/index.js +++ b/index.js @@ -280,7 +280,7 @@ // readmeUrl :: String -> String function readmeUrl(id) { - var version = '0.12.1'; // updated programmatically + var version = '0.12.2'; // updated programmatically return 'https://github.com/sanctuary-js/sanctuary/tree/v' + version + '#' + id; } diff --git a/package.json b/package.json index 0f50468e..b54a3e29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sanctuary", - "version": "0.12.1", + "version": "0.12.2", "description": "Refuge from unsafe JavaScript", "license": "MIT", "repository": {