From c75814f52ea68acd78d1a7b9fb06d3e68dc0cd12 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Sat, 26 May 2018 19:00:49 +0200 Subject: [PATCH] Version 0.17.1 --- README.md | 106 +++++++++++++++++++++++++-------------------------- index.js | 2 +- package.json | 2 +- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 4098011..ad7aa49 100644 --- a/README.md +++ b/README.md @@ -173,54 +173,54 @@ 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. -#### `Array0 :: Type` +#### `Array0 :: Type` Type whose sole member is `[]`. -#### `Array1 :: Type -⁠> Type` +#### `Array1 :: Type -⁠> Type` Constructor for singleton Array types. -#### `Array2 :: Type -⁠> Type -⁠> Type` +#### `Array2 :: Type -⁠> Type -⁠> Type` Constructor for heterogeneous Array types of length 2. `['foo', true]` is a member of `Array2 String Boolean`. -#### `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 :: NonEmpty (Array Type) -⁠> Type` +#### `Function :: NonEmpty (Array Type) -⁠> Type` Constructor for Function types. @@ -230,72 +230,72 @@ 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`][]. -#### `NonNegativeInteger :: Type` +#### `NonNegativeInteger :: Type` Type comprising every non-negative [`Integer`][] value (including `-0`). Also known as the set of natural numbers under ISO 80000-2:2009. -#### `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: @@ -305,23 +305,23 @@ created via: - the `new` operator in conjunction with `Object` or a custom constructor function. -#### `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: @@ -334,34 +334,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 ???`. @@ -378,15 +378,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][]: @@ -405,7 +405,7 @@ An array of [types][]: - [Symbol](#Symbol) - [Undefined](#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. @@ -431,7 +431,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`][]). @@ -495,7 +495,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`][]). @@ -577,7 +577,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 [`Array2`][]). @@ -674,7 +674,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`][]). @@ -696,7 +696,7 @@ const Denomination = $.EnumType ([10, 20, 50, 100, 200]); ``` -#### `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. A field is an @@ -749,7 +749,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 @@ -806,7 +806,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`][]. @@ -853,7 +853,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`][]. @@ -868,12 +868,12 @@ To define a binary type variable `t a b` one must provide: The more detailed explanation of [`UnaryTypeVariable`][] also applies to `BinaryTypeVariable`. -#### `Thunk :: Type -⁠> Type` +#### `Thunk :: Type -⁠> Type` `$.Thunk (T)` is shorthand for `$.Function ([T])`, the type comprising every nullary function (thunk) which returns a value of type `T`. -#### `Predicate :: Type -⁠> Type` +#### `Predicate :: Type -⁠> Type` `$.Predicate (T)` is shorthand for `$.Function ([T, $.Boolean])`, the type comprising every predicate function which takes a value of type `T`. diff --git a/index.js b/index.js index 25112a0..fa8ac54 100644 --- a/index.js +++ b/index.js @@ -428,7 +428,7 @@ // functionUrl :: String -> String function functionUrl(name) { - var version = '0.17.0'; // updated programmatically + var version = '0.17.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 2075753..1431e50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sanctuary-def", - "version": "0.17.0", + "version": "0.17.1", "description": "Run-time type system for JavaScript", "license": "MIT", "repository": {