query
On this page

equals

lib.systems.equals

Docs pulled from | This Revision | 27 minutes ago


Nixpkgs manual

Elaborated systems contain functions, which means that they don't satisfy == for a lack of reflexivity.

They might appear to satisfy == reflexivity when the same exact value is compared to itself, because object identity is used as an "optimization"; compare the value with a reconstruction of itself, e.g. with f == a: f a, or perhaps calling elaborate twice, and one will see reflexivity fail as described.

To solve this, the elaborated systems also store a version of their data without any functions to be compared.

Note that this does not canonicalize the systems, so you'll want to make sure both arguments have been elaborate-d.

Noogle detected

Implementation

The following is the current implementation of this function.

equals = a: b: a._withoutFunctions == b._withoutFunctions;