@@ -12,31 +12,44 @@ open FSharpPlus.Internals
1212
1313type OfSeq =
1414 inherit Default1
15+ #if ! FABLE_ COMPILER
1516 static member inline OfSeq ( x : seq < 't > , _ : '``Foldable' < T > `` , _ : Default5 ) = x |> Seq.map Return.Invoke |> Sum.Invoke : '`` Foldable'<T> ``
17+ #endif
1618 static member OfSeq ( x : seq < 't > , _ : seq < 't > , _ : Default4 ) = x
1719 static member OfSeq ( x : seq < 't > , _ : ICollection < 't > , _ : Default4 ) = let d = ResizeArray () in Seq.iter d.Add x; d :> ICollection< 't>
1820 static member OfSeq ( x : seq < 't > , _ : IList < 't > , _ : Default4 ) = let d = ResizeArray () in Seq.iter d.Add x; d :> IList< 't>
1921 static member OfSeq ( x : seq < 't > , _ : IList , _ : Default4 ) = let d = ResizeArray () in Seq.iter d.Add x; d :> IList
22+
23+ #if ! FABLE_ COMPILER
2024 static member OfSeq ( x : seq < 'k * 'v > , _ : IReadOnlyDictionary < 'k , 'v > , _ : Default4 ) = Dict.toIReadOnlyDictionary ( dict x)
2125 static member OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : IReadOnlyDictionary < 'k , 'v > , _ : Default4 ) = x |> Seq.map (| KeyValue|) |> dict |> Dict.toIReadOnlyDictionary
26+ #endif
27+
2228 static member OfSeq ( x : seq < 'k * 'v > , _ : IDictionary < 'k , 'v > , _ : Default4 ) = dict x
2329 static member OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : IDictionary < 'k , 'v > , _ : Default4 ) = x |> Seq.map (| KeyValue|) |> dict
30+ #if ! FABLE_ COMPILER
2431 static member OfSeq ( x : seq < 'k * 'v > , _ : IDictionary , _ : Default4 ) = let d = Hashtable () in x |> Seq.iter d.Add; d :> IDictionary
2532 static member OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : IDictionary , _ : Default4 ) = let d = Hashtable () in x |> Seq.iter ( function ( KeyValue x) -> d.Add x); d :> IDictionary
33+ #endif
2634 static member inline OfSeq ( x : seq < 't > , _ : 'R , _ : Default3 ) = ( ^R : ( new : seq< 't> -> ^R ) x) : 'R
2735 static member inline OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : 'R , _ : Default3 ) = ( ^R : ( new : seq< 'k* 'v> -> ^R ) ( Seq.map (| KeyValue|) x)) : 'R
2836 static member inline OfSeq ( x : seq < 't > , _ : 'F , _ : Default2 ) = let c = new 'F () in ( Seq.iter ( fun t -> ( ^F : ( member Add : 't -> ^R ) c, t) |> ignore) x); c
37+ #if ! FABLE_ COMPILER
2938 static member OfSeq ( x : seq < 't > , _ : 'T when 'T :> ICollection<'t> , _ : Default1 ) = let d = new 'T () in x |> Seq.iter d.Add; d
3039 static member OfSeq ( x : seq < 'k * 'v > , _ : 'T when 'T :> IDictionary , _ : Default1 ) = let d = new 'T () in x |> Seq.iter d.Add; d
3140 static member OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : 'T when 'T :> IDictionary , _ : Default1 ) = let d = new 'T () in x |> Seq.iter ( function ( KeyValue x) -> d.Add x); d
3241 static member OfSeq ( x : seq < 'k * 'v > , _ : 'T when 'T :> IDictionary<'k , 'v> , _ : OfSeq ) = let d = new 'T () in x |> Seq.iter d.Add; d
3342 static member OfSeq ( x : seq < KeyValuePair < 'k , 'v >>, _ : 'T when 'T :> IDictionary<'k , 'v> , _ : OfSeq ) = let d = new 'T () in x |> Seq.iter d.Add; d
43+ #endif
44+
3445 static member inline OfSeq ( x : seq < 't > , _ : 'UserType , _ : OfSeq ) = ( ^UserType : ( static member OfSeq : seq< 't> -> ^UserType ) x)
3546 static member OfSeq ( x , _ : 't [] , _ : OfSeq ) = Array.ofSeq< 't> x
3647 static member OfSeq ( x , _ : 't list , _ : OfSeq ) = List.ofSeq< 't> x
3748 static member OfSeq ( x : seq < char > , _ : string , _ : OfSeq ) = String.ofSeq x
3849 static member OfSeq ( x : seq < char > , _ : Text.StringBuilder , _ : OfSeq ) = ( StringBuilder (), x) ||> Seq.fold ( fun x -> x.Append)
50+ #if ! FABLE_ COMPILER
3951 static member OfSeq ( x : seq < 't > , _ : Stack < 't > , _ : OfSeq ) = Generic.Stack x
52+ #endif
4053
4154 static member inline Invoke ( value : seq < 't >) =
4255 let inline call_2 ( a : ^a , b : ^b , s ) = (( ^a or ^b ) : ( static member OfSeq : _*_*_ -> _) s, b, a)
@@ -46,31 +59,44 @@ type OfSeq =
4659
4760type OfList =
4861 inherit Default1
62+ #if ! FABLE_ COMPILER
4963 static member inline OfList ( x : list < 't > , _ : '``Foldable' < T > `` , _ : Default5 ) = x |> List.map Return.Invoke |> Sum.Invoke : '`` Foldable'<T> ``
64+ #endif
5065 static member OfList ( x : list < 't > , _ : seq < 't > , _ : Default4 ) = List.toSeq x
5166 static member OfList ( x : list < 't > , _ : ICollection < 't > , _ : Default4 ) = let d = ResizeArray () in List.iter d.Add x; d :> ICollection< 't>
5267 static member OfList ( x : list < 't > , _ : IList < 't > , _ : Default4 ) = let d = ResizeArray () in List.iter d.Add x; d :> IList< 't>
5368 static member OfList ( x : list < 't > , _ : IList , _ : Default4 ) = let d = ResizeArray () in List.iter d.Add x; d :> IList
69+
70+ #if ! FABLE_ COMPILER
5471 static member OfList ( x : list < 'k * 'v > , _ : IReadOnlyDictionary < 'k , 'v > , _ : Default4 ) = Dict.toIReadOnlyDictionary ( dict x)
5572 static member OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : IReadOnlyDictionary < 'k , 'v > , _ : Default4 ) = x |> List.map (| KeyValue|) |> dict |> Dict.toIReadOnlyDictionary
73+ #endif
74+
5675 static member OfList ( x : list < 'k * 'v > , _ : IDictionary < 'k , 'v > , _ : Default4 ) = dict x
5776 static member OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : IDictionary < 'k , 'v > , _ : Default4 ) = x |> List.map (| KeyValue|) |> dict
77+ #if ! FABLE_ COMPILER
5878 static member OfList ( x : list < 'k * 'v > , _ : IDictionary , _ : Default4 ) = let d = Hashtable () in x |> List.iter d.Add; d :> IDictionary
5979 static member OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : IDictionary , _ : Default4 ) = let d = Hashtable () in x |> List.iter ( function ( KeyValue x) -> d.Add x); d :> IDictionary
80+ #endif
6081 static member inline OfList ( x : list < 't > , _ : 'R , _ : Default3 ) = ( ^R : ( new : seq< 't> -> ^R ) ( List.toSeq x)) : 'R
6182 static member inline OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : 'R , _ : Default3 ) = ( ^R : ( new : seq< 'k* 'v> -> ^R ) ( Seq.map (| KeyValue|) x)) : 'R
6283 static member inline OfList ( x : list < 't > , _ : 'F , _ : Default2 ) = let c = new 'F () in ( List.iter ( fun t -> ( ^F : ( member Add : 't -> ^R ) c, t) |> ignore) x); c
84+ #if ! FABLE_ COMPILER
6385 static member OfList ( x : list < 't > , _ : 'T when 'T :> ICollection<'t> , _ : Default1 ) = let d = new 'T () in x |> List.iter d.Add; d
6486 static member OfList ( x : list < 'k * 'v > , _ : 'T when 'T :> IDictionary , _ : Default1 ) = let d = new 'T () in x |> List.iter d.Add; d
6587 static member OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : 'T when 'T :> IDictionary , _ : Default1 ) = let d = new 'T () in x |> List.iter ( function ( KeyValue x) -> d.Add x); d
6688 static member OfList ( x : list < 'k * 'v > , _ : 'T when 'T :> IDictionary<'k , 'v> , _ : OfList ) = let d = new 'T () in x |> List.iter d.Add; d
6789 static member OfList ( x : list < KeyValuePair < 'k , 'v >>, _ : 'T when 'T :> IDictionary<'k , 'v> , _ : OfList ) = let d = new 'T () in x |> List.iter d.Add; d
90+ #endif
91+
6892 static member inline OfList ( x : list < 't > , _ : 'UserType , _ : OfList ) = ( ^UserType : ( static member OfList : list< 't> -> ^UserType ) x)
6993 static member OfList ( x , _ : 't [] , _ : OfList ) = Array.ofList< 't> x
7094 static member OfList ( x , _ : 't list , _ : OfList ) = x
7195 static member OfList ( x : list < char > , _ : string , _ : OfList ) = String.ofList x
7296 static member OfList ( x : list < char > , _ : Text.StringBuilder , _ : OfList ) = ( StringBuilder (), x) ||> List.fold ( fun x -> x.Append)
97+ #if ! FABLE_ COMPILER
7398 static member OfList ( x : list < 't > , _ : Stack < 't > , _ : OfList ) = Generic.Stack x
99+ #endif
74100
75101 static member inline Invoke ( value : list < 't >) =
76102 let inline call_2 ( a : ^a , b : ^b , s ) = (( ^a or ^b ) : ( static member OfList : _*_*_ -> _) s, b, a)
@@ -217,9 +243,10 @@ type Distinct =
217243 static member inline InvokeOnInstance ( source : '``C < 'T > ``) : '``C < 'T > `` = (^ `` C<'T> `` : ( static member Distinct : _ -> _) source) : ^ `` C<'T> ``
218244
219245 static member inline Distinct ( x : '``Collection < 'T > `` , [<Optional>] _impl : Default2 ) = x |> ToSeq.Invoke |> Seq.distinct |> OfSeq.Invoke : '`` Collection<'T> ``
246+ #if ! FABLE_ COMPILER
220247 static member inline Distinct ( x : ^``Collection < 'T > `` , [<Optional>] _impl : Default1 ) = (^ `` Collection<'T> `` : ( static member Distinct : _ -> _) x) : '`` Collection<'T> ``
221248 static member inline Distinct ( _ : ^t when ^t : null and ^t : struct , _mthd : Default1 ) = id
222-
249+ #endif
223250
224251type DistinctBy =
225252 inherit Default1
@@ -290,9 +317,10 @@ type Rev =
290317 static member inline InvokeOnInstance ( source : '``C < 'T > ``) : '``C < 'T > `` = (^ `` C<'T> `` : ( static member Rev : _ -> _) source) : ^ `` C<'T> ``
291318
292319 static member inline Rev ( x : '``Collection < 'T > ``, [<Optional>] _impl : Default2 ) = x |> ToSeq.Invoke |> Seq.rev |> OfSeq.Invoke : '`` Collection<'T> ``
320+ #if ! FABLE_ COMPILER
293321 static member inline Rev ( x : ^``Collection < 'T > ``, [<Optional>] _impl : Default1 ) = (^ `` Collection<'T> `` : ( static member Rev : _ -> _) x) : '`` Collection<'T> ``
294322 static member inline Rev ( _ : ^t when ^t : null and ^t : struct , _mthd : Default1 ) = id
295-
323+ #endif
296324
297325type Scan =
298326 static member Scan ( x : Id < 'T > , f , z : 'S , [<Optional>] _output : Id < 'S > , [<Optional>] _impl : Scan ) = Id.create ( f z x.getValue)
@@ -319,9 +347,10 @@ type Sort =
319347 static member inline InvokeOnInstance ( source : '``C < 'T > ``) : '``C < 'T > `` = (^ `` C<'T> `` : ( static member Sort : _ -> _) source) : ^ `` C<'T> ``
320348
321349 static member inline Sort ( x : '``Collection < 'T > ``, [<Optional>] _impl : Default2 ) = x |> ToSeq.Invoke |> Seq.sort |> OfSeq.Invoke : '`` Collection<'T> ``
350+ #if ! FABLE_ COMPILER
322351 static member inline Sort ( x : ^``Collection < 'T > ``, [<Optional>] _impl : Default1 ) = (^ `` Collection<'T> `` : ( static member Sort : _ -> _) x) : '`` Collection<'T> ``
323352 static member inline Sort ( _ : ^t when ^t : null and ^t : struct , _mthd : Default1 ) = id
324-
353+ #endif
325354
326355type SortBy =
327356 inherit Default1
@@ -374,15 +403,18 @@ type Split =
374403 static member Split (( e : StringBuilder [] , x : StringBuilder ), [<Optional>] _impl : Split ) = x.ToString() .Split ( e |> Seq.map string |> Seq.toArray, StringSplitOptions.None) |> Array.map StringBuilder
375404 static member Split (( e : StringBuilder list , x : StringBuilder ), [<Optional>] _impl : Split ) = x.ToString() .Split ( e |> Seq.map string |> Seq.toArray, StringSplitOptions.None) |> Array.map StringBuilder |> Array.toList
376405
406+
377407 static member inline Invoke ( sep : '``'Collection < 'OrderedCollection > ``) ( source : 'OrderedCollection ) =
378408 let inline call_2 ( a : ^a , b : ^b , s ) = (( ^a or ^b ) : ( static member Split : (_*_)*_ -> _) ( s, b), a)
379409 let inline call ( a : 'a , b : 'b , s ) = call_ 2 ( a, b, s)
380410 call ( Unchecked.defaultof< Split>, source, sep) : '`` 'Collection<'OrderedCollection> ``
381411
382412 type Split with
383413 static member inline Split (( e : '``'Collection < 'OrderedCollection > ``, x: '``'OrderedCollection`` ), [<Optional>] _impl : Default2 ) = x |> ToSeq.Invoke |> Seq.split ( ToSeq.Invoke e) |> Seq.map OfSeq.Invoke |> OfSeq.Invoke : '`` 'Collection<'OrderedCollection> ``
414+ #if ! FABLE_ COMPILER
384415 static member inline Split (( e : '``'Collection < 'OrderedCollection > ``, x: '``'OrderedCollection`` ), [<Optional>] _impl : Default1 ) = (^ `` 'OrderedCollection `` : ( static member Split : _*_ -> _) e, x) : '`` 'Collection<'OrderedCollection> ``
385416 static member inline Split (( _ : ^t when ^t : null and ^t : struct , _ ), _mthd : Default1 ) = id
417+ #endif
386418
387419
388420type Intersperse =
@@ -401,9 +433,11 @@ type Intersperse =
401433
402434type Intercalate =
403435 inherit Default1
436+ #if ! FABLE_ COMPILER
404437 static member inline Intercalate ( x : '``Foldable < 'Monoid > ``, e : 'Monoid , [<Optional>] _impl : Default2 ) = let f t x = match t, x with ( true , _), x -> false , x | (_, acc ), x -> ( false , Plus.Invoke ( Plus.Invoke acc e) x) in Fold.Invoke f ( true , Zero.Invoke ()) x |> snd
405438 static member inline Intercalate ( x : seq < '``Foldable < 'T > ``>, e : '``Foldable < 'T > ``, [<Optional>] _impl : Default1 ) = x |> Seq.map ToSeq.Invoke |> Seq.intercalate ( ToSeq.Invoke e) |> OfSeq.Invoke : '`` Foldable<'T> ``
406439 static member inline Intercalate ( _ : seq < '``Foldable < 'T > ``>, _ : ^t when ^t : null and ^t : struct , _ : Default1 ) = id
440+ #endif
407441 static member Intercalate ( x : seq < list < 'T >> , e : list < 'T > , [<Optional>] _impl : Intercalate ) = List.intercalate e x
408442 static member Intercalate ( x : seq < 'T []> , e : 'T [] , [<Optional>] _impl : Intercalate ) = Array.intercalate e x
409443 static member Intercalate ( x : seq < string > , e : string , [<Optional>] _impl : Intercalate ) = String.Join ( e, x)
0 commit comments