Skip to content

Commit f45a6ec

Browse files
committed
+ Missing Ask and Local for StateT
1 parent 99a5d61 commit f45a6ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/FSharpPlus/Data/State.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,7 @@ type StateT<'s,'``monad<'t * 's>``> with
195195
static member inline Catch (m: StateT<'S,'``MonadError<'E1,'T * 'S>``>, h: 'E1 -> _) =
196196
StateT (fun s -> catch (StateT.run m s) (fun e -> StateT.run (h e) s)) : StateT<'S,'``MonadError<'E2, 'T * 'S>``>
197197

198+
static member inline get_Ask () = StateT.lift ask : StateT<'S, '``MonadReader<'R, 'R>``>
199+
static member inline Local (StateT m, f: 'R1 -> 'R2) = StateT (local f << m) : StateT<'S, '``MonadReader<'R1, 'T>``>
200+
198201
#endif

0 commit comments

Comments
 (0)