diff --git a/README.md b/README.md index 89b241f..6f2e377 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ Conceptually, a type is a set of values. One can think of a value of type `Type` as a function of type `Any -> Boolean` that tests values for membership in the set (though this is an oversimplification). -#### `Unknown :: Type` +#### `Unknown :: Type` Type used to represent missing type information. The type of `[]`, for example, is `Array ???`. @@ -190,7 +190,7 @@ to include an infinite number of types in an environment: - `List (List (List String))` - `...` -#### `Void :: Type` +#### `Void :: Type` Uninhabited type. @@ -198,67 +198,67 @@ May be used to convey that a type parameter of an algebraic data type will not be used. For example, a future of type `Future Void String` will never be rejected. -#### `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. -#### `ValidDate :: Type` +#### `ValidDate :: Type` Type comprising every [`Date`][] value except `new Date (NaN)`. -#### `Descending :: Type -⁠> Type` +#### `Descending :: Type -⁠> Type` [Descending][] type constructor. -#### `Either :: Type -⁠> Type -⁠> Type` +#### `Either :: Type -⁠> Type -⁠> Type` [Either][] type constructor. -#### `Error :: Type` +#### `Error :: Type` Type comprising every Error value, including values of more specific constructors such as [`SyntaxError`][] and [`TypeError`][]. -#### `Fn :: Type -⁠> Type -⁠> Type` +#### `Fn :: Type -⁠> Type -⁠> Type` Binary type constructor for unary function types. `$.Fn (I) (O)` represents `I -> O`, the type of functions that take a value of type `I` and return a value of type `O`. -#### `Function :: NonEmpty (Array Type) -⁠> Type` +#### `Function :: NonEmpty (Array Type) -⁠> Type` Constructor for Function types. @@ -268,108 +268,108 @@ Examples: type; and - `$.Function ([a, b, a])` represents the `(a, b) -> a` type. -#### `HtmlElement :: Type` +#### `HtmlElement :: Type` Type comprising every [HTML element][]. -#### `Identity :: Type -⁠> Type` +#### `Identity :: Type -⁠> Type` [Identity][] type constructor. -#### `JsMap :: Type -⁠> Type -⁠> Type` +#### `JsMap :: Type -⁠> Type -⁠> Type` Constructor for native Map types. `$.JsMap ($.Number) ($.String)`, for example, is the type comprising every native Map whose keys are numbers and whose values are strings. -#### `JsSet :: Type -⁠> Type` +#### `JsSet :: Type -⁠> Type` Constructor for native Set types. `$.JsSet ($.Number)`, for example, is the type comprising every native Set whose values are numbers. -#### `Maybe :: Type -⁠> Type` +#### `Maybe :: Type -⁠> Type` [Maybe][] type constructor. -#### `Module :: Type` +#### `Module :: Type` Type comprising every ES module. -#### `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. -#### `Null :: Type` +#### `Null :: Type` Type whose sole member is `null`. -#### `Nullable :: Type -⁠> Type` +#### `Nullable :: Type -⁠> Type` Constructor for types that include `null` as a member. -#### `Number :: Type` +#### `Number :: Type` Type comprising every primitive Number value (including `NaN`). -#### `PositiveNumber :: Type` +#### `PositiveNumber :: Type` Type comprising every [`Number`][] value greater than zero. -#### `NegativeNumber :: Type` +#### `NegativeNumber :: Type` Type comprising every [`Number`][] value less than zero. -#### `ValidNumber :: Type` +#### `ValidNumber :: Type` Type comprising every [`Number`][] value except `NaN`. -#### `NonZeroValidNumber :: Type` +#### `NonZeroValidNumber :: Type` Type comprising every [`ValidNumber`][] value except `0` and `-0`. -#### `FiniteNumber :: Type` +#### `FiniteNumber :: Type` Type comprising every [`ValidNumber`][] value except `Infinity` and `-Infinity`. -#### `NonZeroFiniteNumber :: Type` +#### `NonZeroFiniteNumber :: Type` Type comprising every [`FiniteNumber`][] value except `0` and `-0`. -#### `PositiveFiniteNumber :: Type` +#### `PositiveFiniteNumber :: Type` Type comprising every [`FiniteNumber`][] value greater than zero. -#### `NegativeFiniteNumber :: Type` +#### `NegativeFiniteNumber :: Type` Type comprising every [`FiniteNumber`][] value less than zero. -#### `Integer :: Type` +#### `Integer :: Type` Type comprising every integer in the range [[`Number.MIN_SAFE_INTEGER`][min] .. [`Number.MAX_SAFE_INTEGER`][max]]. -#### `NonZeroInteger :: Type` +#### `NonZeroInteger :: Type` Type comprising every [`Integer`][] value except `0` and `-0`. -#### `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. -#### `PositiveInteger :: Type` +#### `PositiveInteger :: Type` Type comprising every [`Integer`][] value greater than zero. -#### `NegativeInteger :: Type` +#### `NegativeInteger :: Type` Type comprising every [`Integer`][] value less than zero. -#### `Object :: Type` +#### `Object :: Type` Type comprising every "plain" Object value. Specifically, values created via: @@ -379,38 +379,38 @@ created via: - the `new` operator in conjunction with `Object` or a custom constructor function. -#### `Pair :: Type -⁠> Type -⁠> Type` +#### `Pair :: Type -⁠> Type -⁠> Type` [Pair][] type constructor. -#### `RegExp :: Type` +#### `RegExp :: Type` Type comprising every RegExp value. -#### `GlobalRegExp :: Type` +#### `GlobalRegExp :: Type` Type comprising every [`RegExp`][] value whose `global` flag is `true`. See also [`NonGlobalRegExp`][]. -#### `NonGlobalRegExp :: Type` +#### `NonGlobalRegExp :: Type` Type comprising every [`RegExp`][] value whose `global` flag is `false`. See also [`GlobalRegExp`][]. -#### `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. -#### `RegexFlags :: Type` +#### `RegexFlags :: Type` Type comprising the canonical RegExp flags: @@ -423,23 +423,23 @@ Type comprising the canonical RegExp flags: - `'im'` - `'gim'` -#### `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`. -#### `env :: Array Type` +#### `env :: Array Type` An array of [types][]: @@ -471,7 +471,7 @@ An array of [types][]: - [TypeClass](#TypeClass) - [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. @@ -483,7 +483,7 @@ The environment is only significant if the type contains sanctuary-def provides several functions for defining types. -#### `NullaryType :: String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> Type` +#### `NullaryType :: String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> Type` Type constructor for types with no type variables (such as [`Number`][]). @@ -556,7 +556,7 @@ rem (42) (0); // See http://example.com/my-package#NonZeroInteger for information about the NonZeroInteger type. ``` -#### `UnaryType :: Foldable f => String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> (t a -⁠> f a) -⁠> Type -⁠> Type` +#### `UnaryType :: Foldable f => String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> (t a -⁠> f a) -⁠> Type -⁠> Type` Type constructor for types with one type variable (such as [`Array`][]). @@ -638,7 +638,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 :: Foldable f => String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> (t a b -⁠> f a) -⁠> (t a b -⁠> f b) -⁠> Type -⁠> Type -⁠> Type` +#### `BinaryType :: Foldable f => String -⁠> String -⁠> Array Type -⁠> (Any -⁠> Boolean) -⁠> (t a b -⁠> f a) -⁠> (t a b -⁠> f b) -⁠> Type -⁠> Type -⁠> Type` Type constructor for types with two type variables (such as [`Array2`][]). @@ -735,7 +735,7 @@ showCard (Pair ('X') ('♠')); // See http://example.com/my-package#Rank for information about the Rank type. ``` -#### `EnumType :: String -⁠> String -⁠> Array Any -⁠> Type` +#### `EnumType :: String -⁠> String -⁠> Array Any -⁠> Type` Type constructor for [enumerated types][] (such as [`RegexFlags`][]). @@ -757,7 +757,7 @@ const Denomination = $.EnumType ([10, 20, 50, 100, 200]); ``` -#### `RecordType :: StrMap Type -⁠> Type` +#### `RecordType :: StrMap Type -⁠> Type` `RecordType` is used to construct anonymous record types. The type definition specifies the name and type of each required field. A field is @@ -810,7 +810,7 @@ dist (0); // The value at position 1 is not a member of ‘{ x :: FiniteNumber, y :: FiniteNumber }’. ``` -#### `NamedRecordType :: NonEmpty String -⁠> String -⁠> Array Type -⁠> StrMap Type -⁠> Type` +#### `NamedRecordType :: NonEmpty String -⁠> String -⁠> Array Type -⁠> StrMap Type -⁠> Type` `NamedRecordType` is used to construct named record types. The type definition specifies the name and type of each required field. A field is @@ -867,7 +867,7 @@ volume ({radius: 2}); // See http://example.com/my-package#Cylinder for information about the Cylinder type. ``` -#### `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 @@ -924,7 +924,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`][]. @@ -971,7 +971,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`][]. @@ -986,12 +986,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) that returns a value of type `T`. -#### `Predicate :: Type -⁠> Type` +#### `Predicate :: Type -⁠> Type` `$.Predicate (T)` is shorthand for `$.Fn (T) ($.Boolean)`, the type comprising every predicate function that takes a value of type `T`. @@ -1085,14 +1085,14 @@ concat (null) (null); Multiple constraints may be placed on a type variable by including multiple `TypeClass` values in the array (e.g. `{a: [Foo, Bar, Baz]}`). -[Descending]: https://github.com/sanctuary-js/sanctuary-descending/tree/v2.0.0 -[Either]: https://github.com/sanctuary-js/sanctuary-either/tree/v2.0.0 +[Descending]: https://github.com/sanctuary-js/sanctuary-descending/tree/v2.1.0 +[Either]: https://github.com/sanctuary-js/sanctuary-either/tree/v2.1.0 [FL:Semigroup]: https://github.com/fantasyland/fantasy-land#semigroup [HTML element]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element -[Identity]: https://github.com/sanctuary-js/sanctuary-identity/tree/v2.0.0 -[Maybe]: https://github.com/sanctuary-js/sanctuary-maybe/tree/v2.0.0 +[Identity]: https://github.com/sanctuary-js/sanctuary-identity/tree/v2.1.0 +[Maybe]: https://github.com/sanctuary-js/sanctuary-maybe/tree/v2.1.0 [Monoid]: https://github.com/fantasyland/fantasy-land#monoid -[Pair]: https://github.com/sanctuary-js/sanctuary-pair/tree/v2.0.0 +[Pair]: https://github.com/sanctuary-js/sanctuary-pair/tree/v2.1.0 [Setoid]: https://github.com/fantasyland/fantasy-land#setoid [Unknown]: #Unknown [`Array`]: #Array diff --git a/index.js b/index.js index 5b049c5..a193169 100644 --- a/index.js +++ b/index.js @@ -497,7 +497,7 @@ // functionUrl :: String -> String function functionUrl(name) { - var version = '0.21.0'; // updated programmatically + var version = '0.21.1'; // updated programmatically return 'https://github.com/sanctuary-js/sanctuary-def/tree/v' + version + '#' + name; } diff --git a/package.json b/package.json index 22ecfef..38f5952 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sanctuary-def", - "version": "0.21.0", + "version": "0.21.1", "description": "Run-time type system for JavaScript", "license": "MIT", "repository": {