[Nix-dev] Re: NixOS: New scheme

Ludovic Courtès ludo at gnu.org
Mon Dec 22 23:16:07 CET 2008


"Nicolas Pierron"
<nicolas.b.pierron at gmail.com> writes:

>>> uniqFlatten:
>>> This function takes a list "x" and flatten it with the function
>>
>> What does "flattening a list" mean here?
>
> let
>   a = { foo = ..; };
>   b = { bar = ..; require = [a b]; };
>   c = { baz = ..; require = [a b]; }
> in
>   uniqFlatten prop [] [] [c] == map prop.value [a b c]

Right, but then we'd need to explain what `prop' is, what `prepare' is,
etc.

>>> zip:
>>> This simple function is used to merge all attribute (configuration)
>>> sets into one big configuration set.
>>
>> This makes it sound as though it's equivalent to `//', which it isn't.
>> Looking at the code, I don't clearly understand what it does.  The
>> argument names don't help much, to my defense.  ;-)
>
> zip is common with lists of tuples in other languages, so I have a
> similar things for list of sets.

I was confused since `zip' typically operates on lists (e.g.,
http://srfi.schemers.org/srfi-1/srfi-1.html#zip), while this one
operates on attribute sets but uses lists internally.

I was also confused by the use of the word "set" for "attribute set",
the latter being closer to what other languages refer to as a `record'
or `structure' than to a set in the mathematical sense.

Thanks,
Ludo'.




More information about the nix-dev mailing list