This package exports a single value, Useless
, the sole member of the
sanctuary-useless/Useless type:
// 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
:
eq (Z.Setoid.test (Identity (0))) (true);
Identity Useless
, though, does not satisfy Z.Setoid
, indicating that
a
is constrained in some way:
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:
eq (Z.Functor.test (Identity (Useless))) (true);