Skip to content

Commit

Permalink
Revert "-BindReturn"
Browse files Browse the repository at this point in the history
This reverts commit 78d8835.
  • Loading branch information
wallymathieu committed Feb 23, 2021
1 parent 9ce1279 commit c2db60e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/FSharpPlus/Builders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module GenericBuilders =
member inline __.Yield (x: 'T) = result x : '``Monad<'T>``
member inline __.Bind (p: '``Monad<'T>``, rest: 'T->'``Monad<'U>``) = p >>= rest : '``Monad<'U>``
member inline __.MergeSources (t1: '``Monad<'T>``, t2: '``Monad<'U>``) : '``Monad<'T * 'U>`` = Lift2.Invoke tuple2 t1 t2
member inline __.BindReturn (x : '``Monad<'T>``, f: 'T -> 'U) : '``Monad<'U>`` = Map.Invoke f x

[<CustomOperation("select", MaintainsVariableSpaceUsingBind=true, AllowIntoPattern=true)>]
member inline __.Select (x, [<ProjectionParameter>] f) = map f x
Expand Down
3 changes: 2 additions & 1 deletion tests/FSharpPlus.Tests/General.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ module MonadTransformers =
let _ = put initialState : ChoiceT<State<int, Choice<unit,string>>>

()

#if APPLICATIVE_FIX
[<Test>]
let testStateT () =
let lst1: StateT<string,_> = StateT.lift [1;2]
Expand Down Expand Up @@ -1854,6 +1854,7 @@ module MonadTransformers =
areEqual (Ok 11) x
let y = (fn |> ResultT.run |> Reader.run) -1
areEqual (Error NegativeValue) y
#endif

module ProfunctorDefaults =
type Fun<'T,'U> = Fun of ('T -> 'U) with
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharpPlusFable.Tests/FSharpTests/General.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ let monadTransformers = testList "MonadTransformers" [
let _ = put initialState : ChoiceT<State<int, Choice<unit,string>>>

())
#if !NETSTANDARD3_0
#if APPLICATIVE_FIX
testCase "testStateT" (fun () ->
let lst1: StateT<string,_> = StateT.lift [1;2]
let lst2: StateT<string,_> = StateT.lift [4;5]
Expand Down

0 comments on commit c2db60e

Please sign in to comment.