Skip to content

Commit 098e5d4

Browse files
committed
Use lift for Ask in MonadError
1 parent 6cea3f4 commit 098e5d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/FSharpPlus/Data/Error.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type ResultT<'``monad<Result<'t,'e>>``> with
8787

8888
static member inline CallCC (f: ('T -> ResultT<'``MonadCont<'R,Result<'U,'E>>``>) -> _) : ResultT<'``MonadCont<'R, Result<'T,'E>>``> = ResultT (callCC <| fun c -> ResultT.run (f (ResultT << c << Result<'T, 'E>.Ok)))
8989

90-
static member inline get_Ask () = (ResultT << (map Ok)) ask : ResultT<'``MonadReader<'R,Result<'R,'E>>``>
90+
static member inline get_Ask () = ResultT.lift ask : ResultT<'``MonadReader<'R,Result<'R,'E>>``>
9191
static member inline Local (ResultT m : ResultT<'``MonadReader<'R2,Result<'R2,'E>>``>, f: 'R1->'R2) = ResultT (local f m)
9292

9393
static member inline Tell (w: 'Monoid) = w |> tell |> ResultT.lift : ResultT<'``Writer<'Monoid,Result<unit,'E>>``>
@@ -147,7 +147,7 @@ type ChoiceT<'``monad<Choice<'t,'e>>``> with
147147

148148
static member inline CallCC (f: ('T -> ChoiceT<'``MonadCont<'R,Choice<'U,'E>>``>) -> _) : ChoiceT<'``MonadCont<'R, Choice<'T,'E>>``> = ChoiceT (callCC <| fun c -> ChoiceT.run (f (ChoiceT << c << Choice1Of2)))
149149

150-
static member inline get_Ask () = (ChoiceT << (map Choice1Of2)) ask : ChoiceT<'``MonadReader<'R,Choice<'R,'E>>``>
150+
static member inline get_Ask () = ChoiceT.lift ask : ChoiceT<'``MonadReader<'R,Choice<'R,'E>>``>
151151
static member inline Local (ChoiceT m: ChoiceT<'``MonadReader<'R2,Choice<'R2,'E>>``>, f: 'R1->'R2) = ChoiceT (local f m)
152152

153153
static member inline Tell (w: 'Monoid) = w |> tell |> ChoiceT.lift : ChoiceT<'``Writer<'Monoid,Choice<unit,'E>>``>

0 commit comments

Comments
 (0)