sanctuary-def
Advanced tools
Comparing version 0.16.0 to 0.17.0
{ | ||
"name": "sanctuary-def", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Run-time type system for JavaScript", | ||
@@ -17,8 +17,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"sanctuary-type-classes": "8.1.x", | ||
"sanctuary-show": "1.0.x", | ||
"sanctuary-type-classes": "9.0.x", | ||
"sanctuary-type-identifiers": "2.0.x" | ||
}, | ||
"devDependencies": { | ||
"eslint-plugin-markdown": "1.0.0-beta.7", | ||
"sanctuary-scripts": "1.4.x" | ||
"sanctuary-scripts": "1.6.x" | ||
}, | ||
@@ -25,0 +25,0 @@ "files": [ |
158
README.md
@@ -176,27 +176,27 @@ # sanctuary-def | ||
#### <a name="Any" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L467">`Any :: Type`</a> | ||
#### <a name="Any" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L468">`Any :: Type`</a> | ||
Type comprising every JavaScript value. | ||
#### <a name="AnyFunction" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L472">`AnyFunction :: Type`</a> | ||
#### <a name="AnyFunction" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L473">`AnyFunction :: Type`</a> | ||
Type comprising every Function value. | ||
#### <a name="Arguments" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L477">`Arguments :: Type`</a> | ||
#### <a name="Arguments" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L478">`Arguments :: Type`</a> | ||
Type comprising every [`arguments`][arguments] object. | ||
#### <a name="Array" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L482">`Array :: Type -> Type`</a> | ||
#### <a name="Array" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L483">`Array :: Type -> Type`</a> | ||
Constructor for homogeneous Array types. | ||
#### <a name="Array0" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L487">`Array0 :: Type`</a> | ||
#### <a name="Array0" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L488">`Array0 :: Type`</a> | ||
Type whose sole member is `[]`. | ||
#### <a name="Array1" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L495">`Array1 :: Type -> Type`</a> | ||
#### <a name="Array1" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L496">`Array1 :: Type -> Type`</a> | ||
Constructor for singleton Array types. | ||
#### <a name="Array2" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L504">`Array2 :: Type -> Type -> Type`</a> | ||
#### <a name="Array2" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L505">`Array2 :: Type -> Type -> Type`</a> | ||
@@ -206,11 +206,11 @@ Constructor for heterogeneous Array types of length 2. `['foo', true]` is | ||
#### <a name="Boolean" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L515">`Boolean :: Type`</a> | ||
#### <a name="Boolean" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L516">`Boolean :: Type`</a> | ||
Type comprising `true` and `false`. | ||
#### <a name="Date" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L520">`Date :: Type`</a> | ||
#### <a name="Date" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L521">`Date :: Type`</a> | ||
Type comprising every Date value. | ||
#### <a name="Error" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L525">`Error :: Type`</a> | ||
#### <a name="Error" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L526">`Error :: Type`</a> | ||
@@ -220,3 +220,3 @@ Type comprising every Error value, including values of more specific | ||
#### <a name="FiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L531">`FiniteNumber :: Type`</a> | ||
#### <a name="FiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L532">`FiniteNumber :: Type`</a> | ||
@@ -226,3 +226,3 @@ Type comprising every [`ValidNumber`][] value except `Infinity` and | ||
#### <a name="Function" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L545">`Function :: NonEmpty (Array Type) -> Type`</a> | ||
#### <a name="Function" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L546">`Function :: NonEmpty (Array Type) -> Type`</a> | ||
@@ -237,3 +237,3 @@ Constructor for Function types. | ||
#### <a name="GlobalRegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L584">`GlobalRegExp :: Type`</a> | ||
#### <a name="GlobalRegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L585">`GlobalRegExp :: Type`</a> | ||
@@ -244,3 +244,3 @@ Type comprising every [`RegExp`][] value whose `global` flag is `true`. | ||
#### <a name="Integer" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L594">`Integer :: Type`</a> | ||
#### <a name="Integer" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L595">`Integer :: Type`</a> | ||
@@ -250,15 +250,15 @@ Type comprising every integer in the range | ||
#### <a name="NegativeFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L608">`NegativeFiniteNumber :: Type`</a> | ||
#### <a name="NegativeFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L609">`NegativeFiniteNumber :: Type`</a> | ||
Type comprising every [`FiniteNumber`][] value less than zero. | ||
#### <a name="NegativeInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L616">`NegativeInteger :: Type`</a> | ||
#### <a name="NegativeInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L617">`NegativeInteger :: Type`</a> | ||
Type comprising every [`Integer`][] value less than zero. | ||
#### <a name="NegativeNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L624">`NegativeNumber :: Type`</a> | ||
#### <a name="NegativeNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L625">`NegativeNumber :: Type`</a> | ||
Type comprising every [`Number`][] value less than zero. | ||
#### <a name="NonEmpty" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L632">`NonEmpty :: Type -> Type`</a> | ||
#### <a name="NonEmpty" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L633">`NonEmpty :: Type -> Type`</a> | ||
@@ -270,3 +270,3 @@ Constructor for non-empty types. `$.NonEmpty ($.String)`, for example, is | ||
#### <a name="NonGlobalRegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L648">`NonGlobalRegExp :: Type`</a> | ||
#### <a name="NonGlobalRegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L649">`NonGlobalRegExp :: Type`</a> | ||
@@ -277,3 +277,3 @@ Type comprising every [`RegExp`][] value whose `global` flag is `false`. | ||
#### <a name="NonNegativeInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L658">`NonNegativeInteger :: Type`</a> | ||
#### <a name="NonNegativeInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L659">`NonNegativeInteger :: Type`</a> | ||
@@ -283,27 +283,27 @@ Type comprising every non-negative [`Integer`][] value (including `-0`). | ||
#### <a name="NonZeroFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L667">`NonZeroFiniteNumber :: Type`</a> | ||
#### <a name="NonZeroFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L668">`NonZeroFiniteNumber :: Type`</a> | ||
Type comprising every [`FiniteNumber`][] value except `0` and `-0`. | ||
#### <a name="NonZeroInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L675">`NonZeroInteger :: Type`</a> | ||
#### <a name="NonZeroInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L676">`NonZeroInteger :: Type`</a> | ||
Type comprising every [`Integer`][] value except `0` and `-0`. | ||
#### <a name="NonZeroValidNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L683">`NonZeroValidNumber :: Type`</a> | ||
#### <a name="NonZeroValidNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L684">`NonZeroValidNumber :: Type`</a> | ||
Type comprising every [`ValidNumber`][] value except `0` and `-0`. | ||
#### <a name="Null" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L691">`Null :: Type`</a> | ||
#### <a name="Null" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L692">`Null :: Type`</a> | ||
Type whose sole member is `null`. | ||
#### <a name="Nullable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L696">`Nullable :: Type -> Type`</a> | ||
#### <a name="Nullable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L697">`Nullable :: Type -> Type`</a> | ||
Constructor for types which include `null` as a member. | ||
#### <a name="Number" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L708">`Number :: Type`</a> | ||
#### <a name="Number" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L709">`Number :: Type`</a> | ||
Type comprising every primitive Number value (including `NaN`). | ||
#### <a name="Object" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L713">`Object :: Type`</a> | ||
#### <a name="Object" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L714">`Object :: Type`</a> | ||
@@ -318,19 +318,19 @@ Type comprising every "plain" Object value. Specifically, values | ||
#### <a name="PositiveFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L724">`PositiveFiniteNumber :: Type`</a> | ||
#### <a name="PositiveFiniteNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L725">`PositiveFiniteNumber :: Type`</a> | ||
Type comprising every [`FiniteNumber`][] value greater than zero. | ||
#### <a name="PositiveInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L732">`PositiveInteger :: Type`</a> | ||
#### <a name="PositiveInteger" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L733">`PositiveInteger :: Type`</a> | ||
Type comprising every [`Integer`][] value greater than zero. | ||
#### <a name="PositiveNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L740">`PositiveNumber :: Type`</a> | ||
#### <a name="PositiveNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L741">`PositiveNumber :: Type`</a> | ||
Type comprising every [`Number`][] value greater than zero. | ||
#### <a name="RegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L748">`RegExp :: Type`</a> | ||
#### <a name="RegExp" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L749">`RegExp :: Type`</a> | ||
Type comprising every RegExp value. | ||
#### <a name="RegexFlags" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L753">`RegexFlags :: Type`</a> | ||
#### <a name="RegexFlags" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L754">`RegexFlags :: Type`</a> | ||
@@ -348,3 +348,3 @@ Type comprising the canonical RegExp flags: | ||
#### <a name="StrMap" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L770">`StrMap :: Type -> Type`</a> | ||
#### <a name="StrMap" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L771">`StrMap :: Type -> Type`</a> | ||
@@ -356,23 +356,23 @@ Constructor for homogeneous Object types. | ||
#### <a name="String" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L784">`String :: Type`</a> | ||
#### <a name="String" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L785">`String :: Type`</a> | ||
Type comprising every primitive String value. | ||
#### <a name="Symbol" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L789">`Symbol :: Type`</a> | ||
#### <a name="Symbol" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L790">`Symbol :: Type`</a> | ||
Type comprising every Symbol value. | ||
#### <a name="Type" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L794">`Type :: Type`</a> | ||
#### <a name="Type" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L795">`Type :: Type`</a> | ||
Type comprising every `Type` value. | ||
#### <a name="TypeClass" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L799">`TypeClass :: Type`</a> | ||
#### <a name="TypeClass" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L800">`TypeClass :: Type`</a> | ||
Type comprising every [`TypeClass`][] value. | ||
#### <a name="Undefined" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L805">`Undefined :: Type`</a> | ||
#### <a name="Undefined" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L806">`Undefined :: Type`</a> | ||
Type whose sole member is `undefined`. | ||
#### <a name="Unknown" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L810">`Unknown :: Type`</a> | ||
#### <a name="Unknown" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L811">`Unknown :: Type`</a> | ||
@@ -394,11 +394,11 @@ Type used to represent missing type information. The type of `[]`, | ||
#### <a name="ValidDate" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L829">`ValidDate :: Type`</a> | ||
#### <a name="ValidDate" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L830">`ValidDate :: Type`</a> | ||
Type comprising every [`Date`][] value except `new Date (NaN)`. | ||
#### <a name="ValidNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L837">`ValidNumber :: Type`</a> | ||
#### <a name="ValidNumber" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L838">`ValidNumber :: Type`</a> | ||
Type comprising every [`Number`][] value except `NaN`. | ||
#### <a name="env" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L845">`env :: Array Type`</a> | ||
#### <a name="env" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L846">`env :: Array Type`</a> | ||
@@ -422,3 +422,3 @@ An array of [types][]: | ||
#### <a name="test" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1263">`test :: Array Type -> Type -> a -> Boolean`</a> | ||
#### <a name="test" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1241">`test :: Array Type -> Type -> a -> Boolean`</a> | ||
@@ -449,3 +449,3 @@ Takes an environment, a type, and any value. Returns `true` if the value | ||
#### <a name="NullaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1297">`NullaryType :: String -> String -> (Any -> Boolean) -> Type`</a> | ||
#### <a name="NullaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1275">`NullaryType :: String -> String -> (Any -> Boolean) -> Type`</a> | ||
@@ -514,3 +514,3 @@ Type constructor for types with no type variables (such as [`Number`][]). | ||
#### <a name="UnaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1377">`UnaryType :: String -> String -> (Any -> Boolean) -> (t a -> Array a) -> Type -> Type`</a> | ||
#### <a name="UnaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1355">`UnaryType :: String -> String -> (Any -> Boolean) -> (t a -> Array a) -> Type -> Type`</a> | ||
@@ -537,2 +537,3 @@ Type constructor for types with one type variable (such as [`Array`][]). | ||
```javascript | ||
const show = require ('sanctuary-show'); | ||
const type = require ('sanctuary-type-identifiers'); | ||
@@ -555,6 +556,6 @@ | ||
const Nothing = { | ||
constructor: MaybeTypeRep, | ||
isJust: false, | ||
isNothing: true, | ||
toString: () => 'Nothing', | ||
'constructor': MaybeTypeRep, | ||
'isJust': false, | ||
'isNothing': true, | ||
'@@show': () => 'Nothing', | ||
}; | ||
@@ -564,7 +565,7 @@ | ||
const Just = x => ({ | ||
constructor: MaybeTypeRep, | ||
isJust: true, | ||
isNothing: false, | ||
toString: () => `Just (${Z.toString (x)})`, | ||
value: x, | ||
'constructor': MaybeTypeRep, | ||
'isJust': true, | ||
'isNothing': false, | ||
'@@show': () => `Just (${show (x)})`, | ||
'value': x, | ||
}); | ||
@@ -599,3 +600,3 @@ | ||
#### <a name="BinaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1497">`BinaryType :: String -> String -> (Any -> Boolean) -> (t a b -> Array a) -> (t a b -> Array b) -> Type -> Type -> Type`</a> | ||
#### <a name="BinaryType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1476">`BinaryType :: String -> String -> (Any -> Boolean) -> (t a b -> Array a) -> (t a b -> Array b) -> Type -> Type -> Type`</a> | ||
@@ -652,7 +653,6 @@ Type constructor for types with two type variables (such as | ||
(fst => snd => ({ | ||
constructor: PairTypeRep, | ||
fst, | ||
snd, | ||
toString: () => | ||
`Pair (${Z.toString (fst)}) (${Z.toString (snd)})`, | ||
'constructor': PairTypeRep, | ||
'fst': fst, | ||
'snd': snd, | ||
'@@show': () => `Pair (${show (fst)}) (${show (snd)})`, | ||
})); | ||
@@ -699,3 +699,3 @@ | ||
#### <a name="EnumType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1657">`EnumType :: String -> String -> Array Any -> Type`</a> | ||
#### <a name="EnumType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1635">`EnumType :: String -> String -> Array Any -> Type`</a> | ||
@@ -722,6 +722,7 @@ Type constructor for [enumerated types][] (such as [`RegexFlags`][]). | ||
#### <a name="RecordType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1690">`RecordType :: StrMap Type -> Type`</a> | ||
#### <a name="RecordType" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1668">`RecordType :: StrMap Type -> Type`</a> | ||
`RecordType` is used to construct record types. The type definition | ||
specifies the name and type of each required field. | ||
specifies the name and type of each required field. A field is an | ||
enumerable property (either an own property or an inherited property). | ||
@@ -775,3 +776,3 @@ To define a record type one must provide: | ||
#### <a name="TypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1770">`TypeVariable :: String -> Type`</a> | ||
#### <a name="TypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1752">`TypeVariable :: String -> Type`</a> | ||
@@ -833,3 +834,3 @@ Polymorphism is powerful. Not being able to define a function for | ||
#### <a name="UnaryTypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1833">`UnaryTypeVariable :: String -> Type -> Type`</a> | ||
#### <a name="UnaryTypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1815">`UnaryTypeVariable :: String -> Type -> Type`</a> | ||
@@ -881,3 +882,3 @@ Combines [`UnaryType`][] and [`TypeVariable`][]. | ||
#### <a name="BinaryTypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1897">`BinaryTypeVariable :: String -> Type -> Type -> Type`</a> | ||
#### <a name="BinaryTypeVariable" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1879">`BinaryTypeVariable :: String -> Type -> Type -> Type`</a> | ||
@@ -897,3 +898,3 @@ Combines [`BinaryType`][] and [`TypeVariable`][]. | ||
#### <a name="Thunk" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1937">`Thunk :: Type -> Type`</a> | ||
#### <a name="Thunk" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1919">`Thunk :: Type -> Type`</a> | ||
@@ -903,3 +904,3 @@ `$.Thunk (T)` is shorthand for `$.Function ([T])`, the type comprising | ||
#### <a name="Predicate" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.16.0/index.js#L1947">`Predicate :: Type -> Type`</a> | ||
#### <a name="Predicate" href="https://github.com/sanctuary-js/sanctuary-def/blob/v0.17.0/index.js#L1929">`Predicate :: Type -> Type`</a> | ||
@@ -948,10 +949,6 @@ `$.Predicate (T)` is shorthand for `$.Function ([T, $.Boolean])`, the | ||
since the type must support concatenation (in [mathematical][semigroup] | ||
terms, the type must have a [semigroup][FL:Semigroup]). The run-time type | ||
errors that result when this constraint is violated are not particularly | ||
descriptive: | ||
terms, the type must have a [semigroup][FL:Semigroup]). Violating this | ||
implicit constraint results in a run-time error in the implementation: | ||
```javascript | ||
_concat ({}) ({}); | ||
// ! TypeError: undefined is not a function | ||
_concat (null) (null); | ||
@@ -986,15 +983,2 @@ // ! TypeError: Cannot read property 'concat' of null | ||
concat ({}) ({}); | ||
// ! TypeError: Type-class constraint violation | ||
// | ||
// concat :: Semigroup a => a -> a -> a | ||
// ^^^^^^^^^^^ ^ | ||
// 1 | ||
// | ||
// 1) {} :: Object, StrMap ??? | ||
// | ||
// ‘concat’ requires ‘a’ to satisfy the Semigroup type-class constraint; the value at position 1 does not. | ||
// | ||
// See http://example.com/my-package#Semigroup for information about the my-package/Semigroup type class. | ||
concat (null) (null); | ||
@@ -1001,0 +985,0 @@ // ! TypeError: Type-class constraint violation |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
119241
3
2461
1004
+ Addedsanctuary-show@1.0.x
+ Addedsanctuary-show@1.0.0(transitive)
+ Addedsanctuary-type-classes@9.0.0(transitive)
- Removedsanctuary-type-classes@8.1.1(transitive)
Updatedsanctuary-type-classes@9.0.x