Skip to content

Commit b64b3fc

Browse files
committed
+ Overloads for Return
1 parent bfa151d commit b64b3fc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/FSharpPlus/Control/Monad.fs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ type Return =
136136

137137

138138

139-
static member Return (_: seq<'a> , _: Default2) = fun x -> Seq.singleton x : seq<'a>
140-
static member Return (_: NonEmptySeq<'a>, _: Default2) = fun x -> NonEmptySeq.singleton x : NonEmptySeq<'a>
141-
static member Return (_: IEnumerator<'a>, _: Default2) = fun x -> Enumerator.upto None (fun _ -> x) : IEnumerator<'a>
139+
static member Return (_: seq<'a> , _: Default4) = fun x -> Seq.singleton x : seq<'a>
140+
static member Return (_: NonEmptySeq<'a>, _: Default3) = fun x -> NonEmptySeq.singleton x : NonEmptySeq<'a>
141+
static member Return (_: IEnumerator<'a>, _: Default3) = fun x -> Enumerator.upto None (fun _ -> x) : IEnumerator<'a>
142+
static member Return (_: IDictionary<'k,'t> , _: Default2) = fun x -> Dict.initInfinite x : IDictionary<'k,'t>
143+
static member Return (_: IReadOnlyDictionary<'k,'t>, _: Default3) = fun x -> readOnlyDict [Unchecked.defaultof<'k>, x] : IReadOnlyDictionary<'k,'t>
142144
static member inline Return (_: 'R , _: Default1) = fun (x: 'T) -> Return.InvokeOnInstance x : 'R
143145
static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a>
144146
#if !FABLE_COMPILER
@@ -157,7 +159,6 @@ type Return =
157159
static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x
158160
static member Return (_: Result<'a,'e> , _: Return ) = fun x -> Ok x : Result<'a,'e>
159161
static member Return (_: Choice<'a,'e> , _: Return ) = fun x -> Choice1Of2 x : Choice<'a,'e>
160-
static member Return (_: IDictionary<'k,'t>, _: Return) = fun x -> Dict.initInfinite x : IDictionary<'k,'t>
161162

162163
#if !FABLE_COMPILER
163164
static member Return (_: Expr<'a> , _: Return ) = fun x -> Expr.Cast<'a> (Expr.Value (x: 'a))

0 commit comments

Comments
 (0)