id -package:universum package:cabal-install-solver

Identity function.
id x = x
Identity functor and monad. (a non-strict monad)
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following: The method names refer to the monoid of lists under concatenation, but there are many other instances. Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product. NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.
Uninhabited data type
void value discards or ignores the result of evaluation, such as the return value of an IO action.

Examples

Replace the contents of a Maybe Int with unit:
>>> void Nothing
Nothing

>>> void (Just 3)
Just ()
Replace the contents of an Either Int Int with unit, resulting in an Either Int ():
>>> void (Left 8675309)
Left 8675309

>>> void (Right 8675309)
Right ()
Replace every element of a list with unit:
>>> void [1,2,3]
[(),(),()]
Replace the second element of a pair with unit:
>>> void (1,2)
(1,())
Discard the result of an IO action:
>>> mapM print [1,2]
1
2
[(),()]

>>> void $ mapM print [1,2]
1
2
Validate linked packages Verify that linked packages have
  • Linked dependencies,
  • Equal flag assignments
  • Equal stanza assignments
Type alias so we can use the shorter name PackageId.
The name and version of a package.
Avoid reinstalls. This is a tricky strategy. If a package version is installed already and the same version is available from a repo, the repo version will never be chosen. This would result in a reinstall (either destructively, or potentially, shadowing). The old instance won't be visible or even present anymore, but other packages might have depended on it. TODO: It would be better to actually check the reverse dependencies of installed packages. If they're not depended on, then reinstalling should be fine. Even if they are, perhaps this should just result in trying to reinstall those other packages as well. However, doing this all neatly in one pass would require to change the builder, or at least to change the goal set after building.
Interface.
Removes a single package from the index.
Does a lookup by package id (name & version). Since multiple package DBs mask each other case-sensitively by package name, then we get back at most one package.
Override-merge of two indexes. Packages from the second mask packages of the same exact name (case-sensitively) from the first.