Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanctuary-js/sanctuary-useless
Data type with no functionality (useful for testing)
https://github.com/sanctuary-js/sanctuary-useless
sanctuary
Last synced: about 2 months ago
JSON representation
Data type with no functionality (useful for testing)
- Host: GitHub
- URL: https://github.com/sanctuary-js/sanctuary-useless
- Owner: sanctuary-js
- License: mit
- Created: 2018-05-06T16:46:14.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T12:07:46.000Z (2 months ago)
- Last Synced: 2024-10-28T15:22:10.577Z (2 months ago)
- Topics: sanctuary
- Language: JavaScript
- Homepage:
- Size: 74.2 KB
- Stars: 5
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# sanctuary-useless
This package exports a single value, `Useless`, the sole member of the
sanctuary-useless/Useless type:```javascript
// Useless :: Useless
const Useless = require ('sanctuary-useless');
````Useless`, as its name suggests, has no functionality. This makes it useful
for testing algebraic data types which satisfy various [type classes][].The following assertion, in isolation, suggests that `Identity a` satisfies
[`Z.Setoid`][] _for all_ `a`:```javascript
eq (Z.Setoid.test (Identity (0))) (true);
````Identity Useless`, though, does not satisfy `Z.Setoid`, indicating that
`a` is constrained in some way:```javascript
eq (Z.Setoid.test (Identity (Useless))) (false);
eq (Z.Setoid.test (Identity (0))) (true);
```Conversely, one can use `Useless` to demonstrate universal quantification
where applicable:```javascript
eq (Z.Functor.test (Identity (Useless))) (true);
```[`Z.Setoid`]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v12.1.0#Setoid
[type classes]: https://github.com/sanctuary-js/sanctuary-type-classes/tree/v12.1.0