Skip to content

Commit 8f5bd4a

Browse files
committed
reorg
1 parent cc98aed commit 8f5bd4a

7 files changed

Lines changed: 33 additions & 30 deletions

File tree

nix/framework/curried-st.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{ config, ... }:
2+
let
3+
inherit (config.priv) st;
4+
in
5+
{
6+
# ---------------------------------------------------------------------------
7+
# ST :: namespace of curried stream combinators (stream as last param)
8+
#
9+
# Enables point-free composition: (ST.apply "fn" arg) as a stream fn
10+
# ---------------------------------------------------------------------------
11+
priv.ST = {
12+
__functor = _: st;
13+
map = f: stream: stream.map f;
14+
filter = p: stream: stream.filter p;
15+
concat = otherS: stream: stream.concat otherS;
16+
flatMap = f: stream: stream.flatMap f;
17+
sub = {
18+
__functor =
19+
_: name: stream:
20+
stream.sub name;
21+
apply =
22+
name: value: stream:
23+
stream.sub.apply name value;
24+
flat = name: stream: stream.sub.flat name;
25+
};
26+
};
27+
}

nix/framework/drivers/host-os-d.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ in
66
# hostOsD :: topoS -> ST comp -> ST
77
# Driver factory: fans out hosts from topoS, wraps results as { host, osConfiguration }.
88
priv.hostOsD = topoS: compS: hostsT topoS (osConfigD compS);
9-
}
9+
}

nix/framework/drivers/host-users-d.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ in
66
# hostUsersD :: topoS -> ST comp -> ST
77
# Driver factory: fans out hosts then users from topoS, maps output per user.
88
priv.hostUsersD = topoS: compS: hostsT topoS (usersT (hostUserD compS));
9-
}
9+
}

nix/framework/drivers/os-config-d.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ in
2020
{
2121
priv = { inherit osConfigD; };
2222
}
23-
24-

nix/framework/drivers/select-host-d.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# selectHostD :: name -> ST -> ST
33
# Filter stream of { host, … } items to those where host.name == name.
44
priv.selectHostD = name: streamS: streamS.filter (item: item.host.name == name);
5-
}
5+
}

nix/framework/forward/host-user-d.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let
1717
};
1818
})
1919
);
20-
in
20+
in
2121
{
2222
priv = { inherit hostUserD; };
23-
}
23+
}

nix/kernel/st.nix

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@ let
33
# Empty ST — identity for concat, base for chaining: ned.st val1 val2 ...
44
st = wrap (fx.stream.done null);
55

6-
# ---------------------------------------------------------------------------
7-
# ST :: namespace of curried stream combinators (stream as last param)
8-
#
9-
# Enables point-free composition: (ST.apply "fn" arg) as a stream fn
10-
# ---------------------------------------------------------------------------
11-
ST = {
12-
__functor = _: st;
13-
map = f: stream: stream.map f;
14-
filter = p: stream: stream.filter p;
15-
concat = otherS: stream: stream.concat otherS;
16-
flatMap = f: stream: stream.flatMap f;
17-
sub = {
18-
__functor =
19-
_: name: stream:
20-
stream.sub name;
21-
apply =
22-
name: value: stream:
23-
stream.sub.apply name value;
24-
flat = name: stream: stream.sub.flat name;
25-
};
26-
};
27-
286
# ---------------------------------------------------------------------------
297
# wrap :: fx.stream -> ST
308
#
@@ -97,5 +75,5 @@ let
9775
self;
9876
in
9977
{
100-
priv = { inherit wrap st ST; };
78+
priv = { inherit wrap st; };
10179
}

0 commit comments

Comments
 (0)