mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-18 15:39:46 +03:00
svn path=/nixpkgs/trunk/; revision=16412
This commit is contained in:
parent
9075d2a2cd
commit
10c4ec0ed8
2 changed files with 4 additions and 2 deletions
|
@ -33,11 +33,11 @@ rec {
|
||||||
else "x is attr set { ${attrNamesToStr x} }"
|
else "x is attr set { ${attrNamesToStr x} }"
|
||||||
else if isFunction x then "x is a function"
|
else if isFunction x then "x is a function"
|
||||||
else if x == [] then "x is an empty list"
|
else if x == [] then "x is an empty list"
|
||||||
else if isList x then "x is a list, first item is : ${showVal (head x)}"
|
else if isList x then "x is a list, first element is: ${showVal (head x)}"
|
||||||
else if x == true then "x is boolean true"
|
else if x == true then "x is boolean true"
|
||||||
else if x == false then "x is boolean false"
|
else if x == false then "x is boolean false"
|
||||||
else if x == null then "x is null"
|
else if x == null then "x is null"
|
||||||
else "x is probably a string starting, starting characters: ${substring 0 50 x}..";
|
else "x is probably a string `${substring 0 50 x}...'";
|
||||||
# trace the arguments passed to function and its result
|
# trace the arguments passed to function and its result
|
||||||
traceCall = n : f : a : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a));
|
traceCall = n : f : a : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a));
|
||||||
traceCall2 = n : f : a : b : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
|
traceCall2 = n : f : a : b : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
|
||||||
|
|
|
@ -110,6 +110,8 @@ rec {
|
||||||
fold = op: nul: v: if v == null then nul else elemType.fold op nul v;
|
fold = op: nul: v: if v == null then nul else elemType.fold op nul v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# !!! this should be a type constructor that takes the options as
|
||||||
|
# an argument.
|
||||||
optionSet = mkOptionType {
|
optionSet = mkOptionType {
|
||||||
name = "option set";
|
name = "option set";
|
||||||
check = x: lib.traceValIfNot builtins.isAttrs x;
|
check = x: lib.traceValIfNot builtins.isAttrs x;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue