Skip to content

Commit e4aa158

Browse files
committed
Try using simple Sequence implementation
1 parent 82ee400 commit e4aa158

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/FSharpPlus/Data/NonEmptySeq.fs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,8 @@ type NonEmptySeq<'t> =
107107
yield Async.RunSynchronously (f enum.Current, cancellationToken = ct) } |> NonEmptySeq<_>.unsafeOfSeq }
108108
// #endif
109109

110-
static member inline SequenceImpl (t, _, _:obj) = printfn "Using default4"; Sequence.ForInfiniteSequences (t, IsLeftZero.Invoke, NonEmptySeq<_>.ofList , Return.Invoke)
111-
static member SequenceImpl (t: NonEmptySeq<option<'T>>, _: option<NonEmptySeq<'T>>, _:Sequence) : option<NonEmptySeq<'T>> = printfn "Not using default4"; Option.Sequential t |> Option.map NonEmptySeq<_>.unsafeOfSeq
112-
113-
static member SequenceImpl (t: NonEmptySeq<Result<'T, 'E>>) : Result<NonEmptySeq<'T>, 'E> = Result.Sequential t |> Result.map NonEmptySeq<_>.unsafeOfSeq
114-
static member SequenceImpl (t: NonEmptySeq<Choice<'T, 'E>>) : Choice<NonEmptySeq<'T>, 'E> = Choice.Sequential t |> Choice.map NonEmptySeq<_>.unsafeOfSeq
115-
static member SequenceImpl (t: NonEmptySeq<list<'T>> , _: list<NonEmptySeq<'T>> , _:Sequence) : list<NonEmptySeq<'T>> = printfn "Not using default4"; Sequence.ForInfiniteSequences (t, List.isEmpty , NonEmptySeq<_>.ofList, List.singleton)
116-
static member SequenceImpl (t: NonEmptySeq<'T []> ) : NonEmptySeq<'T> [] = Sequence.ForInfiniteSequences (t, Array.isEmpty, NonEmptySeq<_>.ofList, Array.singleton)
117-
// #if !FABLE_COMPILER
118-
static member SequenceImpl (t: NonEmptySeq<Async<'T>> ) : Async<NonEmptySeq<'T>> = Async.SequentialLazy t |> Async.map NonEmptySeq<_>.unsafeOfSeq
119-
120-
static member inline Sequence (t: NonEmptySeq<'``Applicative<'T>``>) : '``Applicative<NonEmptySeq<'T>>`` =
121-
let inline call_3 (a: ^a, b: ^b, c: ^c) = ((^a or ^b or ^c) : (static member SequenceImpl : _*_*_ -> _) b, c, a)
122-
let inline call (a: 'a, b: 'b) = call_3 (a, b, Unchecked.defaultof<'R>) : 'R
123-
call (Unchecked.defaultof<Sequence>, t)
110+
static member inline Sequence (t: NonEmptySeq<'``Applicative<'T>``>) =
111+
Sequence.ForInfiniteSequences (t, IsLeftZero.Invoke, NonEmptySeq<_>.ofList, Return.Invoke) : '``Applicative<NonEmptySeq<'T>>``
124112

125113
#endif
126114

0 commit comments

Comments
 (0)