Skip to content

Commit

Permalink
Merge pull request #19 from sanctuary-js/davidchambers/type-identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers authored Nov 3, 2019
2 parents 0a1d916 + 3b2e851 commit 52c34b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
22 changes: 7 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 ❌ ',
Expand Down Expand Up @@ -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)`.
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 52c34b8

Please sign in to comment.