diff --git a/index.js b/index.js index 14ab853..8bfad17 100644 --- a/index.js +++ b/index.js @@ -54,9 +54,12 @@ /* eslint-enable no-unused-vars */ } + var identityTypeIdent = 'sanctuary-identity/Identity@1'; + var prototype = { /* eslint-disable key-spacing */ 'constructor': Identity, + '@@type': identityTypeIdent, '@@show': Identity$prototype$show, 'fantasy-land/map': Identity$prototype$map, 'fantasy-land/ap': Identity$prototype$ap, @@ -81,11 +84,14 @@ //. ```javascript //. > const Useless = require ('sanctuary-useless') //. + //. > const isTypeClass = x => + //. . type (x) === 'sanctuary-type-classes/TypeClass@1' + //. //. > S.map (k => k + ' '.repeat (16 - k.length) + //. . (Z[k].test (Identity (Useless)) ? '\u2705 ' : //. . Z[k].test (Identity (['foo'])) ? '\u2705 * ' : //. . /* otherwise */ '\u274C ')) - //. . (S.keys (S.unchecked.filter (S.is ($.TypeClass)) (Z))) + //. . (S.keys (S.unchecked.filter (isTypeClass) (Z))) //. [ 'Setoid ✅ * ', // if ‘a’ satisfies Setoid //. . 'Ord ✅ * ', // if ‘a’ satisfies Ord //. . 'Semigroupoid ❌ ', @@ -136,19 +142,6 @@ return identity; } - //# Identity.@@type :: String - //. - //. Identity [type identifier][]. - //. - //. ```javascript - //. > type (Identity (42)) - //. 'sanctuary-identity/Identity@1' - //. - //. > type.parse (type (Identity (42))) - //. {namespace: 'sanctuary-identity', name: 'Identity', version: 1} - //. ``` - Identity['@@type'] = 'sanctuary-identity/Identity@1'; - //# Identity.fantasy-land/of :: a -> Identity a //. //. `of (Identity) (x)` is equivalent to `Identity (x)`. @@ -334,5 +327,4 @@ //. [`Z.equals`]: v:sanctuary-js/sanctuary-type-classes#equals //. [`Z.lte`]: v:sanctuary-js/sanctuary-type-classes#lte //. [iff]: https://en.wikipedia.org/wiki/If_and_only_if -//. [type identifier]: v:sanctuary-js/sanctuary-type-identifiers //. [type representative]: v:fantasyland/fantasy-land#type-representatives diff --git a/package.json b/package.json index 81060ea..2be4d72 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "sanctuary-show": "1.0.x", - "sanctuary-type-classes": "11.0.0" + "sanctuary-type-classes": "12.0.0" }, "devDependencies": { "fantasy-land": "4.0.1", @@ -24,8 +24,8 @@ "sanctuary": "2.0.1", "sanctuary-def": "0.20.x", "sanctuary-scripts": "3.2.x", - "sanctuary-type-identifiers": "2.0.1", - "sanctuary-useless": "1.1.x" + "sanctuary-type-identifiers": "3.0.0", + "sanctuary-useless": "2.0.x" }, "scripts": { "doctest": "sanctuary-doctest",