about summary refs log tree commit diff
path: root/nix/stateMonad/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-10-01T18·46+0200
committersterni <sternenseemann@systemli.org>2022-10-08T10·59+0000
commit70427fd93470536c36b2fa8a6c9446f746dcfbec (patch)
treeabebd92912912b9209f5fce625ecd17da9465954 /nix/stateMonad/default.nix
parent3fab3b780b04f6cbddf6cdef625adb095c8702e3 (diff)
refactor(nix/stateMonad): optimize after r/5062
This should save on one function application which can be a big deal for
bigger for_ loops, I suspect. It's not really complicated, so why not.

Change-Id: I2bfcd254e55f1bea366b09de294b2bef9f5b5dda
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6834
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'nix/stateMonad/default.nix')
-rw-r--r--nix/stateMonad/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/stateMonad/default.nix b/nix/stateMonad/default.nix
index 8f92241753df..209412e09952 100644
--- a/nix/stateMonad/default.nix
+++ b/nix/stateMonad/default.nix
@@ -17,7 +17,7 @@ rec {
     (f afterAction.value) afterAction.state;
 
   # Type: stateMonad s a -> stateMonad s b -> stateMonad s b
-  after = action1: action2: bind action1 (_: action2);
+  after = action1: action2: state: action2 (action1 state).state;
 
   # Type: stateMonad s (stateMonad s a) -> stateMonad s a
   join = action: bind action (action': action');