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 <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2022-10-01 20:46:06 +02:00
parent 3fab3b780b
commit 70427fd934

View file

@ -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');