Compare commits
10 commits
0a63667459
...
9315751220
Author | SHA1 | Date | |
---|---|---|---|
Jake Hamilton | 9315751220 | ||
Jake Hamilton | b414e151e6 | ||
Jake Hamilton | af571a03a4 | ||
Jake Hamilton | e76e67fe58 | ||
Jake Hamilton | 7385b21950 | ||
Jake Hamilton | bd51f4a088 | ||
Jake Hamilton | 0e03546da5 | ||
Jake Hamilton | 1f7ab7d09c | ||
Jake Hamilton | aa0fd6128b | ||
Jake Hamilton | 2be3111b2c |
|
@ -68,7 +68,6 @@ in
|
|||
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
||||
export ac_cv_func_getpgrp_void=yes
|
||||
export ac_cv_func_tzset=yes
|
||||
chmod 0755 missing
|
||||
bash ./configure \
|
||||
--build=${platform.build} \
|
||||
--host=${platform.host} \
|
||||
|
|
|
@ -58,7 +58,6 @@ in
|
|||
|
||||
# Configure
|
||||
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
||||
chmod 0755 missing
|
||||
bash ./configure \
|
||||
--build=${platform.build} \
|
||||
--host=${platform.host} \
|
||||
|
|
|
@ -59,7 +59,6 @@ in
|
|||
export ac_cv_sizeof_unsigned_long=4
|
||||
export ac_cv_sizeof_long_long=8
|
||||
export ac_cv_header_netdb_h=no
|
||||
chmod 0755 missing
|
||||
bash ./configure \
|
||||
--prefix=$out \
|
||||
--build=${platform.build} \
|
||||
|
|
|
@ -21,7 +21,7 @@ lib: {
|
|||
## Apply a topological sort to a DAG.
|
||||
##
|
||||
## @type Dag a -> { result :: List a } | { cycle :: List a, loops :: List a }
|
||||
topological =
|
||||
topographic =
|
||||
graph:
|
||||
let
|
||||
getEntriesBefore =
|
||||
|
@ -43,7 +43,7 @@ lib: {
|
|||
|
||||
isBefore = a: b: builtins.elem a.name b.after;
|
||||
|
||||
sorted = lib.lists.sort.topological isBefore entries;
|
||||
sorted = lib.lists.sort.topographic isBefore entries;
|
||||
in
|
||||
if sorted ? result then
|
||||
{
|
||||
|
|
|
@ -119,11 +119,11 @@ in
|
|||
};
|
||||
|
||||
"sort" = {
|
||||
"topological" = {
|
||||
"topographic" = {
|
||||
"handles an empty graph" =
|
||||
let
|
||||
expected = [ ];
|
||||
actual = lib.dag.sort.topological { };
|
||||
actual = lib.dag.sort.topographic { };
|
||||
in
|
||||
actual.result == expected;
|
||||
|
||||
|
@ -147,7 +147,7 @@ in
|
|||
value = "d";
|
||||
}
|
||||
];
|
||||
actual = lib.dag.sort.topological {
|
||||
actual = lib.dag.sort.topographic {
|
||||
a = lib.dag.entry.anywhere "a";
|
||||
b = lib.dag.entry.between [ "c" ] [ "a" ] "b";
|
||||
c = lib.dag.entry.before [ "c" ] "c";
|
||||
|
|
|
@ -31,15 +31,15 @@ lib: {
|
|||
in
|
||||
builtins.map (x: builtins.elemAt x 1) (builtins.sort isLess prepared);
|
||||
|
||||
## Perform a topological sort on a list of items. The predicate function determines whether
|
||||
## Perform a topographic sort on a list of items. The predicate function determines whether
|
||||
## its first argument comes before the second argument.
|
||||
##
|
||||
## @type (a -> a -> Bool) -> List a -> List a
|
||||
topological =
|
||||
topographic =
|
||||
predicate: list:
|
||||
let
|
||||
searched = lib.lists.search.depthFirst true predicate list;
|
||||
results = lib.lists.sort.topological predicate (searched.visited ++ searched.rest);
|
||||
results = lib.lists.sort.topographic predicate (searched.visited ++ searched.rest);
|
||||
in
|
||||
if builtins.length list < 2 then
|
||||
{ result = list; }
|
||||
|
|
Loading…
Reference in a new issue