
30 Dec
2015
30 Dec
'15
5:18 p.m.
On 29 December 2015 at 10:32, David Turner
As soon as I sent this, I think I hit on the answer. There's no getting away from having to write a strategy like this:
evalActualsWith :: Strategy [ActualShift] -> Strategy User evalActualsWith strat user = do actuals' <- strat $ actuals user return $ user { actuals = actuals' }
Hang on, isn't evalActualsWith just the lens for the actuals field with a slightly more specialised type? That's pretty cool. Cheers, David