Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Nov 3, 2019
1 parent 52c34b8 commit d723b66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ always contains exactly one value, of type `a`.
```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 All @@ -41,7 +44,7 @@ always contains exactly one value, of type `a`.
. 'Contravariant ❌ ' ]
```

#### <a name="Identity" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L122">`Identity :: a -⁠> Identity a`</a>
#### <a name="Identity" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L121">`Identity :: a -⁠> Identity a`</a>

Identity's sole data constructor. Additionally, it serves as the
Identity [type representative][].
Expand All @@ -51,19 +54,7 @@ Identity [type representative][].
Identity (42)
```

#### <a name="Identity.@@type" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L146">`Identity.@@type :: String`</a>

Identity [type identifier][].

```javascript
> type (Identity (42))
'sanctuary-identity/Identity@1'

> type.parse (type (Identity (42)))
{namespace: 'sanctuary-identity', name: 'Identity', version: 1}
```

#### <a name="Identity.fantasy-land/of" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L159">`Identity.fantasy-land/of :: a -⁠> Identity a`</a>
#### <a name="Identity.fantasy-land/of" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L145">`Identity.fantasy-land/of :: a -⁠> Identity a`</a>

`of (Identity) (x)` is equivalent to `Identity (x)`.

Expand All @@ -72,7 +63,7 @@ Identity [type identifier][].
Identity (42)
```

#### <a name="Identity.fantasy-land/chainRec" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L172">`Identity.fantasy-land/chainRec :: ((a -⁠> c, b -⁠> c, a) -⁠> Identity c, a) -⁠> Identity b`</a>
#### <a name="Identity.fantasy-land/chainRec" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L158">`Identity.fantasy-land/chainRec :: ((a -⁠> c, b -⁠> c, a) -⁠> Identity c, a) -⁠> Identity b`</a>

```javascript
> Z.chainRec (
Expand All @@ -90,7 +81,7 @@ Identity (64)
Identity (0)
```

#### <a name="Identity.prototype.@@show" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L195">`Identity#@@show :: Showable a => Identity a ~> () -⁠> String`</a>
#### <a name="Identity.prototype.@@show" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L181">`Identity#@@show :: Showable a => Identity a ~> () -⁠> String`</a>

`show (Identity (x))` is equivalent to `'Identity (' + show (x) + ')'`.

Expand All @@ -99,7 +90,7 @@ Identity (0)
'Identity (["foo", "bar", "baz"])'
```

#### <a name="Identity.prototype.fantasy-land/equals" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L207">`Identity#fantasy-land/equals :: Setoid a => Identity a ~> Identity a -⁠> Boolean`</a>
#### <a name="Identity.prototype.fantasy-land/equals" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L193">`Identity#fantasy-land/equals :: Setoid a => Identity a ~> Identity a -⁠> Boolean`</a>

`Identity (x)` is equal to `Identity (y)` [iff][] `x` is equal to `y`
according to [`Z.equals`][].
Expand All @@ -112,7 +103,7 @@ true
false
```

#### <a name="Identity.prototype.fantasy-land/lte" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L223">`Identity#fantasy-land/lte :: Ord a => Identity a ~> Identity a -⁠> Boolean`</a>
#### <a name="Identity.prototype.fantasy-land/lte" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L209">`Identity#fantasy-land/lte :: Ord a => Identity a ~> Identity a -⁠> Boolean`</a>

`Identity (x)` is less than or equal to `Identity (y)` [iff][] `x` is
less than or equal to `y` according to [`Z.lte`][].
Expand All @@ -123,7 +114,7 @@ less than or equal to `y` according to [`Z.lte`][].
[Identity (0), Identity (1)]
```

#### <a name="Identity.prototype.fantasy-land/concat" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L237">`Identity#fantasy-land/concat :: Semigroup a => Identity a ~> Identity a -⁠> Identity a`</a>
#### <a name="Identity.prototype.fantasy-land/concat" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L223">`Identity#fantasy-land/concat :: Semigroup a => Identity a ~> Identity a -⁠> Identity a`</a>

`concat (Identity (x)) (Identity (y))` is equivalent to
`Identity (concat (x) (y))`.
Expand All @@ -133,7 +124,7 @@ less than or equal to `y` according to [`Z.lte`][].
Identity ([1, 2, 3, 4, 5, 6])
```

#### <a name="Identity.prototype.fantasy-land/map" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L250">`Identity#fantasy-land/map :: Identity a ~> (a -⁠> b) -⁠> Identity b`</a>
#### <a name="Identity.prototype.fantasy-land/map" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L236">`Identity#fantasy-land/map :: Identity a ~> (a -⁠> b) -⁠> Identity b`</a>

`map (f) (Identity (x))` is equivalent to `Identity (f (x))`.

Expand All @@ -142,7 +133,7 @@ Identity ([1, 2, 3, 4, 5, 6])
Identity (8)
```

#### <a name="Identity.prototype.fantasy-land/ap" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L262">`Identity#fantasy-land/ap :: Identity a ~> Identity (a -⁠> b) -⁠> Identity b`</a>
#### <a name="Identity.prototype.fantasy-land/ap" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L248">`Identity#fantasy-land/ap :: Identity a ~> Identity (a -⁠> b) -⁠> Identity b`</a>

`ap (Identity (f)) (Identity (x))` is equivalent to `Identity (f (x))`.

Expand All @@ -151,7 +142,7 @@ Identity (8)
Identity (8)
```

#### <a name="Identity.prototype.fantasy-land/chain" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L274">`Identity#fantasy-land/chain :: Identity a ~> (a -⁠> Identity b) -⁠> Identity b`</a>
#### <a name="Identity.prototype.fantasy-land/chain" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L260">`Identity#fantasy-land/chain :: Identity a ~> (a -⁠> Identity b) -⁠> Identity b`</a>

`chain (f) (Identity (x))` is equivalent to `f (x)`.

Expand All @@ -160,7 +151,7 @@ Identity (8)
Identity (100)
```

#### <a name="Identity.prototype.fantasy-land/reduce" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L286">`Identity#fantasy-land/reduce :: Identity a ~> ((b, a) -⁠> b, b) -⁠> b`</a>
#### <a name="Identity.prototype.fantasy-land/reduce" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L272">`Identity#fantasy-land/reduce :: Identity a ~> ((b, a) -⁠> b, b) -⁠> b`</a>

`reduce (f) (x) (Identity (y))` is equivalent to `f (x) (y)`.

Expand All @@ -169,7 +160,7 @@ Identity (100)
[1, 2, 3, 4, 5, 6]
```

#### <a name="Identity.prototype.fantasy-land/traverse" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L298">`Identity#fantasy-land/traverse :: Applicative f => Identity a ~> (TypeRep f, a -⁠> f b) -⁠> f (Identity b)`</a>
#### <a name="Identity.prototype.fantasy-land/traverse" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L284">`Identity#fantasy-land/traverse :: Applicative f => Identity a ~> (TypeRep f, a -⁠> f b) -⁠> f (Identity b)`</a>

`traverse (_) (f) (Identity (x))` is equivalent to
`map (Identity) (f (x))`.
Expand All @@ -179,7 +170,7 @@ Identity (100)
[Identity (101), Identity (102), Identity (103)]
```

#### <a name="Identity.prototype.fantasy-land/extend" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L311">`Identity#fantasy-land/extend :: Identity a ~> (Identity a -⁠> b) -⁠> Identity b`</a>
#### <a name="Identity.prototype.fantasy-land/extend" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L297">`Identity#fantasy-land/extend :: Identity a ~> (Identity a -⁠> b) -⁠> Identity b`</a>

`extend (f) (Identity (x))` is equivalent to
`Identity (f (Identity (x)))`.
Expand All @@ -189,7 +180,7 @@ Identity (100)
Identity (100)
```

#### <a name="Identity.prototype.fantasy-land/extract" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v1.2.0/index.js#L324">`Identity#fantasy-land/extract :: Identity a ~> () -⁠> a`</a>
#### <a name="Identity.prototype.fantasy-land/extract" href="https://github.com/sanctuary-js/sanctuary-identity/blob/v2.0.0/index.js#L310">`Identity#fantasy-land/extract :: Identity a ~> () -⁠> a`</a>

`extract (Identity (x))` is equivalent to `x`.

Expand All @@ -199,8 +190,7 @@ Identity (100)
```

[Fantasy Land]: https://github.com/fantasyland/fantasy-land/tree/v4.0.1
[`Z.equals`]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v11.0.0#equals
[`Z.lte`]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v11.0.0#lte
[`Z.equals`]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v12.0.0#equals
[`Z.lte`]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v12.0.0#lte
[iff]: https://en.wikipedia.org/wiki/If_and_only_if
[type identifier]: https://github.com/sanctuary-js/sanctuary-type-identifiers/tree/v2.0.1
[type representative]: https://github.com/fantasyland/fantasy-land/tree/v4.0.1#type-representatives
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanctuary-identity",
"version": "1.2.0",
"version": "2.0.0",
"description": "Fantasy Land -compliant Identity type",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit d723b66

Please sign in to comment.