Skip to content

Commit 9075ecc

Browse files
refactor(nix/stateMonad): optimize after
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 <[email protected]> Tested-by: BuildkiteCI
1 parent b3eaba0 commit 9075ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stateMonad/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rec {
1717
(f afterAction.value) afterAction.state;
1818

1919
# Type: stateMonad s a -> stateMonad s b -> stateMonad s b
20-
after = action1: action2: bind action1 (_: action2);
20+
after = action1: action2: state: action2 (action1 state).state;
2121

2222
# Type: stateMonad s (stateMonad s a) -> stateMonad s a
2323
join = action: bind action (action': action');

0 commit comments

Comments
 (0)