From 056a6499b491e13e88be263c8e149eccd15640a4 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Mon, 22 May 2017 07:45:13 +0200 Subject: [PATCH] Version 0.11.1 --- README.md | 98 +++++++++++++++++++++++++-------------------------- index.js | 2 +- package.json | 2 +- test/index.js | 2 +- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index dcdb48f..37e156f 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ add('X'); // The value at position 1 is not a member of ‘Number’. ``` -

__ :: Placeholder

+

__ :: Placeholder

The special placeholder value. @@ -182,41 +182,41 @@ Conceptually, a type is a set of values. One can think of a value of type `Type` as a function of type `Any -> Boolean` which tests values for membership in the set (though this is an oversimplification). -

Any :: Type

+

Any :: Type

Type comprising every JavaScript value. -

AnyFunction :: Type

+

AnyFunction :: Type

Type comprising every Function value. -

Arguments :: Type

+

Arguments :: Type

Type comprising every [`arguments`][arguments] object. -

Array :: Type -> Type

+

Array :: Type -> Type

Constructor for homogeneous Array types. -

Boolean :: Type

+

Boolean :: Type

Type comprising `true` and `false`. -

Date :: Type

+

Date :: Type

Type comprising every Date value. -

Error :: Type

+

Error :: Type

Type comprising every Error value, including values of more specific constructors such as [`SyntaxError`][] and [`TypeError`][]. -

FiniteNumber :: Type

+

FiniteNumber :: Type

Type comprising every [`ValidNumber`][] value except `Infinity` and `-Infinity`. -

Function :: Array Type -> Type

+

Function :: Array Type -> Type

Constructor for Function types. @@ -226,67 +226,67 @@ Examples: type; and - `$.Function([a, b, a])` represents the `(a, b) -> a` type. -

GlobalRegExp :: Type

+

GlobalRegExp :: Type

Type comprising every [`RegExp`][] value whose `global` flag is `true`. See also [`NonGlobalRegExp`][]. -

Integer :: Type

+

Integer :: Type

Type comprising every integer in the range [[`Number.MIN_SAFE_INTEGER`][min] .. [`Number.MAX_SAFE_INTEGER`][max]]. -

NegativeFiniteNumber :: Type

+

NegativeFiniteNumber :: Type

Type comprising every [`FiniteNumber`][] value less than zero. -

NegativeInteger :: Type

+

NegativeInteger :: Type

Type comprising every [`Integer`][] value less than zero. -

NegativeNumber :: Type

+

NegativeNumber :: Type

Type comprising every [`Number`][] value less than zero. -

NonEmpty :: Type -> Type

+

NonEmpty :: Type -> Type

Constructor for non-empty types. `$.NonEmpty($.String)`, for example, is the type comprising every [`String`][] value except `''`. The given type must satisfy the [Monoid][] and [Setoid][] specifications. -

NonGlobalRegExp :: Type

+

NonGlobalRegExp :: Type

Type comprising every [`RegExp`][] value whose `global` flag is `false`. See also [`GlobalRegExp`][]. -

NonZeroFiniteNumber :: Type

+

NonZeroFiniteNumber :: Type

Type comprising every [`FiniteNumber`][] value except `0` and `-0`. -

NonZeroInteger :: Type

+

NonZeroInteger :: Type

Type comprising every [`Integer`][] value except `0` and `-0`. -

NonZeroValidNumber :: Type

+

NonZeroValidNumber :: Type

Type comprising every [`ValidNumber`][] value except `0` and `-0`. -

Null :: Type

+

Null :: Type

Type whose sole member is `null`. -

Nullable :: Type -> Type

+

Nullable :: Type -> Type

Constructor for types which include `null` as a member. -

Number :: Type

+

Number :: Type

Type comprising every primitive Number value (including `NaN`). -

Object :: Type

+

Object :: Type

Type comprising every "plain" Object value. Specifically, values created via: @@ -296,28 +296,28 @@ created via: - the `new` operator in conjunction with `Object` or a custom constructor function. -

Pair :: Type -> Type -> Type

+

Pair :: Type -> Type -> Type

Constructor for tuple types of length 2. Arrays are said to represent tuples. `['foo', 42]` is a member of `Pair String Number`. -

PositiveFiniteNumber :: Type

+

PositiveFiniteNumber :: Type

Type comprising every [`FiniteNumber`][] value greater than zero. -

PositiveInteger :: Type

+

PositiveInteger :: Type

Type comprising every [`Integer`][] value greater than zero. -

PositiveNumber :: Type

+

PositiveNumber :: Type

Type comprising every [`Number`][] value greater than zero. -

RegExp :: Type

+

RegExp :: Type

Type comprising every RegExp value. -

RegexFlags :: Type

+

RegexFlags :: Type

Type comprising the canonical RegExp flags: @@ -330,34 +330,34 @@ Type comprising the canonical RegExp flags: - `'im'` - `'gim'` -

StrMap :: Type -> Type

+

StrMap :: Type -> Type

Constructor for homogeneous Object types. `{foo: 1, bar: 2, baz: 3}`, for example, is a member of `StrMap Number`; `{foo: 1, bar: 2, baz: 'XXX'}` is not. -

String :: Type

+

String :: Type

Type comprising every primitive String value. -

Symbol :: Type

+

Symbol :: Type

Type comprising every Symbol value. -

Type :: Type

+

Type :: Type

Type comprising every `Type` value. -

TypeClass :: Type

+

TypeClass :: Type

Type comprising every [`TypeClass`][] value. -

Undefined :: Type

+

Undefined :: Type

Type whose sole member is `undefined`. -

Unknown :: Type

+

Unknown :: Type

Type used to represent missing type information. The type of `[]`, for example, is `Array ???`. @@ -374,15 +374,15 @@ to include an infinite number of types in an environment: - `List (List (List String))` - `...` -

ValidDate :: Type

+

ValidDate :: Type

Type comprising every [`Date`][] value except `new Date(NaN)`. -

ValidNumber :: Type

+

ValidNumber :: Type

Type comprising every [`Number`][] value except `NaN`. -

env :: Array Type

+

env :: Array Type

An array of [types][]: @@ -401,7 +401,7 @@ An array of [types][]: - Symbol - Undefined -

test :: Array Type -> Type -> a -> Boolean

+

test :: Array Type -> Type -> a -> Boolean

Takes an environment, a type, and any value. Returns `true` if the value is a member of the type; `false` otherwise. @@ -428,7 +428,7 @@ and validate the bodies of incoming POST requests against these types. sanctuary-def provides several functions for defining types. -

NullaryType :: String -> String -> (Any -> Boolean) -> Type

+

NullaryType :: String -> String -> (Any -> Boolean) -> Type

Type constructor for types with no type variables (such as [`Number`][]). @@ -491,7 +491,7 @@ rem(42, 0); // The value at position 1 is not a member of ‘NonZeroInteger’. ``` -

UnaryType :: String -> String -> (Any -> Boolean) -> (t a -> Array a) -> (Type -> Type)

+

UnaryType :: String -> String -> (Any -> Boolean) -> (t a -> Array a) -> (Type -> Type)

Type constructor for types with one type variable (such as [`Array`][]). @@ -570,7 +570,7 @@ fromMaybe(0, Just('XXX')); // Since there is no type of which all the above values are members, the type-variable constraint has been violated. ``` -

BinaryType :: String -> String -> (Any -> Boolean) -> (t a b -> Array a) -> (t a b -> Array b) -> (Type -> Type -> Type)

+

BinaryType :: String -> String -> (Any -> Boolean) -> (t a b -> Array a) -> (t a b -> Array b) -> (Type -> Type -> Type)

Type constructor for types with two type variables (such as [`Pair`][]). @@ -661,7 +661,7 @@ showCard(Pair('X', '♠')); // The value at position 1 is not a member of ‘Rank’. ``` -

EnumType :: String -> String -> Array Any -> Type

+

EnumType :: String -> String -> Array Any -> Type

Type constructor for [enumerated types][] (such as [`RegexFlags`][]). @@ -684,7 +684,7 @@ const Denomination = $.EnumType( ); ``` -

RecordType :: StrMap Type -> Type

+

RecordType :: StrMap Type -> Type

`RecordType` is used to construct record types. The type definition specifies the name and type of each required field. @@ -734,7 +734,7 @@ dist(0); // The value at position 1 is not a member of ‘{ x :: FiniteNumber, y :: FiniteNumber }’. ``` -

TypeVariable :: String -> Type

+

TypeVariable :: String -> Type

Polymorphism is powerful. Not being able to define a function for all types would be very limiting indeed: one couldn't even define the @@ -788,7 +788,7 @@ cmp(0, '1'); // Since there is no type of which all the above values are members, the type-variable constraint has been violated. ``` -

UnaryTypeVariable :: String -> (Type -> Type)

+

UnaryTypeVariable :: String -> (Type -> Type)

Combines [`UnaryType`][] and [`TypeVariable`][]. @@ -835,7 +835,7 @@ example, is `v`. One could replace `Functor => f` with `Map k` or with This shallow inspection makes it possible to constrain a value's "outer" and "inner" types independently. -

BinaryTypeVariable :: String -> (Type -> Type -> Type)

+

BinaryTypeVariable :: String -> (Type -> Type -> Type)

Combines [`BinaryType`][] and [`TypeVariable`][]. diff --git a/index.js b/index.js index 423157d..7b7103b 100644 --- a/index.js +++ b/index.js @@ -405,7 +405,7 @@ // functionUrl :: String -> String function functionUrl(name) { - var version = '0.11.0'; // updated programmatically + var version = '0.11.1'; // updated programmatically return 'https://github.com/sanctuary-js/sanctuary-def/tree/v' + version + '#' + stripNamespace(name); } diff --git a/package.json b/package.json index cf2e533..a6f0b62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sanctuary-def", - "version": "0.11.0", + "version": "0.11.1", "description": "Run-time type system for JavaScript", "license": "MIT", "repository": { diff --git a/test/index.js b/test/index.js index c54ed31..f02aeea 100644 --- a/test/index.js +++ b/test/index.js @@ -36,7 +36,7 @@ function throws(f, type, message) { } // version :: String -var version = '0.11.0'; // updated programmatically +var version = '0.11.1'; // updated programmatically var def = $.create({checkTypes: true, env: $.env});