From 70427fd93470536c36b2fa8a6c9446f746dcfbec Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 1 Oct 2022 20:46:06 +0200 Subject: 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 Tested-by: BuildkiteCI --- nix/stateMonad/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nix/stateMonad/default.nix') 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'); -- cgit 1.4.1