on master help sign in
Use '!' in Effect.State
commitc48303e0e62a8a40182fc6d31019293f55168b4d authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSat 19 Oct 2013, 13:26 (13 years ago) parentd2f5480
1 file changed+2−4
effects/Effect/State.idr+2−4
effects/Effect/State.idr+2−4
@@ -26,12 +26,10 @@ putM : y -> EffM m [STATE x] [STATE y] ()
2626putM val = Put val
2727
2828update : (x -> x) -> Eff m [STATE x] ()
29−update f = do val <- get
30− put (f val)
29+update f = put (f !get)
3130
3231updateM : (x -> y) -> EffM m [STATE x] [STATE y] ()
33−updateM f = do val <- get
34− putM (f val)
32+updateM f = putM (f !get)
3533
3634locally : x -> Eff m [STATE x] t -> Eff m [STATE y] t
3735locally newst prog = do st <- get