fix
function - https://github.com/NixOS/nixpkgs/blob/9f087964709174424bca681b600af8ee8e763df5/lib/fixed-points.nix#L19 , https://en.m.wikipedia.org/wiki/Fixed_point_(mathematics) , point where x = f(x) = f(f(f(f....f(x)....)))
rec { a = 1; b = a + 1; }
is the same as fix (self: { a = 1; b = self.a + 1; })
builtins.trace
- https://github.com/NixOS/nixpkgs/blob/9f087964709174424bca681b600af8ee8e763df5/lib/debug.nix#L4 trace has different flavors, http://hackage.haskell.org/package/base-4.12.0.0/docs/Debug-Trace.html#v:trace all lazy languages have trace
builtins.seq
- in lazy languages data is represented as thunks (IF data has not been yet evaluated THEN it's pointer on function that should produce this data ELSE it's pointer on data), builtins.seq
forces first layer of data to evaluate (evaluates it to WHNF?), builtins.deepSeq
is recursive variant of seq
, it forces whole data to evaluate (evaluates it to NF?), (more https://wiki.haskell.org/Seq, https://www.google.com/amp/s/amp.reddit.