diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
index f851d9ca395..ecc6aec03b6 100644
--- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj
@@ -93,6 +93,11 @@
+
+
+
+
+
diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule.fs
new file mode 100644
index 00000000000..65531fdf073
--- /dev/null
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule.fs
@@ -0,0 +1,1166 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Collections
+
+open System
+open NUnit.Framework
+
+open FSharp.Core.Unittests.LibraryTestFx
+
+// Various tests for the:
+// Microsoft.FSharp.Collections.iseq type
+
+(*
+[Test Strategy]
+Make sure each method works on:
+* Integer ISeq (value type)
+* String ISeq (reference type)
+* Empty ISeq (0 elements)
+* Null ISeq (null)
+*)
+
+type iseq<'a> = FSharp.Collections.SeqComposition.ISeq<'a>
+
+[]
+type ISeqModule() =
+ let iseq (x:seq<_>) = x |> ISeq.ofSeq
+
+ []
+ member this.AllPairs() =
+
+ // integer ISeq
+ let resultInt = ISeq.allPairs (iseq [1..7]) (iseq [11..17])
+ let expectedInt =
+ iseq <| seq { for i in 1..7 do
+ for j in 11..17 do
+ yield i, j }
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr = ISeq.allPairs (iseq ["str3";"str4"]) (iseq ["str1";"str2"])
+ let expectedStr = iseq ["str3","str1";"str3","str2";"str4","str1";"str4","str2"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ VerifySeqsEqual ISeq.empty <| ISeq.allPairs ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty <| ISeq.allPairs (iseq { 1..7 }) ISeq.empty
+ VerifySeqsEqual ISeq.empty <| ISeq.allPairs ISeq.empty (iseq { 1..7 })
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.allPairs null null |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.allPairs null (iseq [1..7]) |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.allPairs (iseq [1..7]) null |> ignore)
+ ()
+
+ []
+ member this.CachedSeq_Clear() =
+
+ let evaluatedItems : int list ref = ref []
+ let cachedSeq =
+ ISeq.initInfinite (fun i -> evaluatedItems := i :: !evaluatedItems; i)
+ |> ISeq.cache
+
+ // Verify no items have been evaluated from the ISeq yet
+ Assert.AreEqual(List.length !evaluatedItems, 0)
+
+ // Force evaluation of 10 elements
+ ISeq.take 10 cachedSeq
+ |> ISeq.toList
+ |> ignore
+
+ // verify ref clear switch length
+ Assert.AreEqual(List.length !evaluatedItems, 10)
+
+ // Force evaluation of 10 elements
+ ISeq.take 10 cachedSeq
+ |> ISeq.toList
+ |> ignore
+
+ // Verify ref clear switch length (should be cached)
+ Assert.AreEqual(List.length !evaluatedItems, 10)
+
+
+ // Clear
+ (box cachedSeq :?> System.IDisposable) .Dispose()
+
+ // Force evaluation of 10 elements
+ ISeq.take 10 cachedSeq
+ |> ISeq.toList
+ |> ignore
+
+ // Verify length of evaluatedItemList is 20
+ Assert.AreEqual(List.length !evaluatedItems, 20)
+ ()
+
+ []
+ member this.Append() =
+
+ // empty ISeq
+ let emptySeq1 = ISeq.empty
+ let emptySeq2 = ISeq.empty
+ let appendEmptySeq = ISeq.append emptySeq1 emptySeq2
+ let expectResultEmpty = ISeq.empty
+
+ VerifySeqsEqual expectResultEmpty appendEmptySeq
+
+ // Integer ISeq
+ let integerSeq1:iseq = iseq [0..4]
+ let integerSeq2:iseq = iseq [5..9]
+
+ let appendIntergerSeq = ISeq.append integerSeq1 integerSeq2
+
+ let expectResultInteger = iseq <| seq { for i in 0..9 -> i}
+
+ VerifySeqsEqual expectResultInteger appendIntergerSeq
+
+
+ // String ISeq
+ let stringSeq1:iseq = iseq ["1";"2"]
+ let stringSeq2:iseq = iseq ["3";"4"]
+
+ let appendStringSeq = ISeq.append stringSeq1 stringSeq2
+
+ let expectedResultString = iseq ["1";"2";"3";"4"]
+
+ VerifySeqsEqual expectedResultString appendStringSeq
+
+ // null ISeq
+ let nullSeq1 = iseq [null;null]
+
+ let nullSeq2 =iseq [null;null]
+
+ let appendNullSeq = ISeq.append nullSeq1 nullSeq2
+
+ let expectedResultNull = iseq [ null;null;null;null]
+
+ VerifySeqsEqual expectedResultNull appendNullSeq
+
+ ()
+
+ []
+ member this.replicate() =
+ // replicate should create multiple copies of the given value
+ Assert.IsTrue(ISeq.isEmpty <| ISeq.replicate 0 null)
+ Assert.IsTrue(ISeq.isEmpty <| ISeq.replicate 0 1)
+ Assert.AreEqual(null, ISeq.head <| ISeq.replicate 1 null)
+ Assert.AreEqual(["1";"1"],ISeq.replicate 2 "1" |> ISeq.toList)
+
+ CheckThrowsArgumentException (fun () -> ISeq.replicate -1 null |> ignore)
+
+
+ []
+ member this.Average() =
+ // empty ISeq
+ let emptySeq:iseq = ISeq.empty
+
+ CheckThrowsArgumentException (fun () -> ISeq.average emptySeq |> ignore)
+
+
+ // double ISeq
+ let doubleSeq:iseq = iseq [1.0;2.2;2.5;4.3]
+
+ let averageDouble = ISeq.average doubleSeq
+
+ Assert.IsFalse( averageDouble <> 2.5)
+
+ // float32 ISeq
+ let floatSeq:iseq = iseq [ 2.0f;4.4f;5.0f;8.6f]
+
+ let averageFloat = ISeq.average floatSeq
+
+ Assert.IsFalse( averageFloat <> 5.0f)
+
+ // decimal ISeq
+ let decimalSeq:iseq = iseq [ 0M;19M;19.03M]
+
+ let averageDecimal = ISeq.average decimalSeq
+
+ Assert.IsFalse( averageDecimal <> 12.676666666666666666666666667M )
+
+ //// null ISeq
+ //let nullSeq:iseq = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.average nullSeq |> ignore)
+ ()
+
+
+ []
+ member this.AverageBy() =
+ // empty ISeq
+ let emptySeq:iseq = ISeq.empty
+
+ CheckThrowsArgumentException (fun () -> ISeq.averageBy (fun x -> x+1.0) emptySeq |> ignore)
+
+ // double ISeq
+ let doubleSeq:iseq = iseq [1.0;2.2;2.5;4.3]
+
+ let averageDouble = ISeq.averageBy (fun x -> x-2.0) doubleSeq
+
+ Assert.IsFalse( averageDouble <> 0.5 )
+
+ // float32 ISeq
+ let floatSeq:iseq = iseq [ 2.0f;4.4f;5.0f;8.6f]
+
+ let averageFloat = ISeq.averageBy (fun x -> x*3.3f) floatSeq
+
+ Assert.IsFalse( averageFloat <> 16.5f )
+
+ // decimal ISeq
+ let decimalSeq:iseq = iseq [ 0M;19M;19.03M]
+
+ let averageDecimal = ISeq.averageBy (fun x -> x/10.7M) decimalSeq
+
+ Assert.IsFalse( averageDecimal <> 1.1847352024922118380062305296M )
+
+ //// null ISeq
+ //let nullSeq:iseq = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.averageBy (fun (x:double)->x+4.0) nullSeq |> ignore)
+ ()
+
+ []
+ member this.Cache() =
+ // empty ISeq
+ let emptySeq:iseq = ISeq.empty
+
+ let cacheEmpty = ISeq.cache emptySeq
+
+ let expectedResultEmpty = ISeq.empty
+
+ VerifySeqsEqual expectedResultEmpty cacheEmpty
+
+ // double ISeq
+ let doubleSeq:iseq = iseq [1.0;2.2;2.5;4.3]
+
+ let cacheDouble = ISeq.cache doubleSeq
+
+ VerifySeqsEqual doubleSeq cacheDouble
+
+
+ // float32 ISeq
+ let floatSeq:iseq = iseq [ 2.0f;4.4f;5.0f;8.6f]
+
+ let cacheFloat = ISeq.cache floatSeq
+
+ VerifySeqsEqual floatSeq cacheFloat
+
+ // decimal ISeq
+ let decimalSeq:iseq = iseq [ 0M; 19M; 19.03M]
+
+ let cacheDecimal = ISeq.cache decimalSeq
+
+ VerifySeqsEqual decimalSeq cacheDecimal
+
+ // null ISeq
+ let nullSeq = iseq [null]
+
+ let cacheNull = ISeq.cache nullSeq
+
+ VerifySeqsEqual nullSeq cacheNull
+ ()
+
+ []
+ member this.Case() =
+
+ // integer ISeq
+ let integerArray = [|1;2|]
+ let integerSeq = ISeq.cast integerArray
+
+ let expectedIntegerSeq = iseq [1;2]
+
+ VerifySeqsEqual expectedIntegerSeq integerSeq
+
+ // string ISeq
+ let stringArray = [|"a";"b"|]
+ let stringSeq = ISeq.cast stringArray
+
+ let expectedStringSeq = iseq["a";"b"]
+
+ VerifySeqsEqual expectedStringSeq stringSeq
+
+ // empty ISeq
+ let emptySeq = ISeq.cast ISeq.empty
+ let expectedEmptySeq = ISeq.empty
+
+ VerifySeqsEqual expectedEmptySeq ISeq.empty
+
+ // null ISeq
+ let nullArray = [|null;null|]
+ let NullSeq = ISeq.cast nullArray
+ let expectedNullSeq = iseq [null;null]
+
+ VerifySeqsEqual expectedNullSeq NullSeq
+
+ CheckThrowsExn(fun () ->
+ let strings =
+ integerArray
+ |> ISeq.cast
+ for o in strings do ())
+
+ CheckThrowsExn(fun () ->
+ let strings =
+ integerArray
+ |> ISeq.cast
+ :> System.Collections.IEnumerable // without this upcast the for loop throws, so it should with this upcast too
+ for o in strings do ())
+
+ ()
+
+ []
+ member this.Choose() =
+
+ // int ISeq
+ let intSeq = iseq [1..20]
+ let funcInt x = if (x%5=0) then Some x else None
+ let intChoosed = ISeq.choose funcInt intSeq
+ let expectedIntChoosed = iseq <| seq { for i = 1 to 4 do yield i*5}
+
+
+
+ VerifySeqsEqual expectedIntChoosed intChoosed
+
+ // string ISeq
+ let stringSrc = iseq ["list";"List"]
+ let funcString x = match x with
+ | "list"-> Some x
+ | "List" -> Some x
+ | _ -> None
+ let strChoosed = ISeq.choose funcString stringSrc
+ let expectedStrChoose = iseq ["list";"List"]
+
+ VerifySeqsEqual expectedStrChoose strChoosed
+
+ // empty ISeq
+ let emptySeq = ISeq.empty
+ let emptyChoosed = ISeq.choose funcInt emptySeq
+
+ let expectedEmptyChoose = ISeq.empty
+
+ VerifySeqsEqual expectedEmptyChoose emptySeq
+
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.choose funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.ChunkBySize() =
+
+ let verify expected actual =
+ ISeq.zip expected actual
+ |> ISeq.iter ((<||) VerifySeqsEqual)
+
+ // int ISeq
+ verify (iseq [[1..4];[5..8]]) <| ISeq.chunkBySize 4 (iseq {1..8})
+ verify (iseq [[1..4];[5..8];[9..10]]) <| ISeq.chunkBySize 4 (iseq {1..10})
+ verify (iseq [[1]; [2]; [3]; [4]]) <| ISeq.chunkBySize 1 (iseq {1..4})
+
+ ISeq.chunkBySize 2 (ISeq.initInfinite id)
+ |> ISeq.take 3
+ |> verify (iseq [[0;1];[2;3];[4;5]])
+
+ ISeq.chunkBySize 1 (ISeq.initInfinite id)
+ |> ISeq.take 5
+ |> verify (iseq [[0];[1];[2];[3];[4]])
+
+ // string ISeq
+ verify (iseq [["a"; "b"];["c";"d"];["e"]]) <| ISeq.chunkBySize 2 (iseq ["a";"b";"c";"d";"e"])
+
+ // empty ISeq
+ verify ISeq.empty <| ISeq.chunkBySize 3 ISeq.empty
+
+ //// null ISeq
+ //let nullSeq:iseq<_> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.chunkBySize 3 nullSeq |> ignore)
+
+ // invalidArg
+ CheckThrowsArgumentException (fun () -> ISeq.chunkBySize 0 (iseq {1..10}) |> ignore)
+ CheckThrowsArgumentException (fun () -> ISeq.chunkBySize -1 (iseq {1..10}) |> ignore)
+
+ ()
+
+ []
+ member this.SplitInto() =
+
+ let verify expected actual =
+ ISeq.zip expected actual
+ |> ISeq.iter ((<||) VerifySeqsEqual)
+
+ // int ISeq
+ ISeq.splitInto 3 (iseq {1..10}) |> verify (iseq [ {1..4}; {5..7}; {8..10} ])
+ ISeq.splitInto 3 (iseq {1..11}) |> verify (iseq [ {1..4}; {5..8}; {9..11} ])
+ ISeq.splitInto 3 (iseq {1..12}) |> verify (iseq [ {1..4}; {5..8}; {9..12} ])
+
+ ISeq.splitInto 4 (iseq {1..5}) |> verify (iseq [ [1..2]; [3]; [4]; [5] ])
+ ISeq.splitInto 20 (iseq {1..4}) |> verify (iseq [ [1]; [2]; [3]; [4] ])
+
+ // string ISeq
+ ISeq.splitInto 3 (iseq ["a";"b";"c";"d";"e"]) |> verify (iseq [ ["a"; "b"]; ["c";"d"]; ["e"] ])
+
+ // empty ISeq
+ VerifySeqsEqual [] <| ISeq.splitInto 3 (iseq [])
+
+ //// null ISeq
+ //let nullSeq:iseq<_> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.splitInto 3 nullSeq |> ignore)
+
+ // invalidArg
+ CheckThrowsArgumentException (fun () -> ISeq.splitInto 0 (iseq [1..10]) |> ignore)
+ CheckThrowsArgumentException (fun () -> ISeq.splitInto -1 (iseq [1..10]) |> ignore)
+
+ ()
+
+ []
+ member this.Compare() =
+
+ // int ISeq
+ let intSeq1 = iseq [1;3;7;9]
+ let intSeq2 = iseq [2;4;6;8]
+ let funcInt x y = if (x>y) then x else 0
+ let intcompared = ISeq.compareWith funcInt intSeq1 intSeq2
+
+ Assert.IsFalse( intcompared <> 7 )
+
+ // string ISeq
+ let stringSeq1 = iseq ["a"; "b"]
+ let stringSeq2 = iseq ["c"; "d"]
+ let funcString x y = match (x,y) with
+ | "a", "c" -> 0
+ | "b", "d" -> 1
+ |_ -> -1
+ let strcompared = ISeq.compareWith funcString stringSeq1 stringSeq2
+ Assert.IsFalse( strcompared <> 1 )
+
+ // empty ISeq
+ let emptySeq = ISeq.empty
+ let emptycompared = ISeq.compareWith funcInt emptySeq emptySeq
+
+ Assert.IsFalse( emptycompared <> 0 )
+
+ //// null ISeq
+ //let nullSeq:iseq = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.compareWith funcInt nullSeq emptySeq |> ignore)
+ //CheckThrowsArgumentNullException (fun () -> ISeq.compareWith funcInt emptySeq nullSeq |> ignore)
+ //CheckThrowsArgumentNullException (fun () -> ISeq.compareWith funcInt nullSeq nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Concat() =
+ // integer ISeq
+ let seqInt =
+ iseq <| seq { for i in 0..9 do
+ yield iseq <| seq {for j in 0..9 do
+ yield i*10+j}}
+ let conIntSeq = ISeq.concat seqInt
+ let expectedIntSeq = iseq <| seq { for i in 0..99 do yield i}
+
+ VerifySeqsEqual expectedIntSeq conIntSeq
+
+ // string ISeq
+ let strSeq =
+ iseq <| seq { for a in 'a' .. 'b' do
+ for b in 'a' .. 'b' do
+ yield iseq [a; b] }
+
+ let conStrSeq = ISeq.concat strSeq
+ let expectedStrSeq = iseq ['a';'a';'a';'b';'b';'a';'b';'b';]
+ VerifySeqsEqual expectedStrSeq conStrSeq
+
+ // Empty ISeq
+ let emptySeqs = iseq [iseq[ ISeq.empty;ISeq.empty];iseq[ ISeq.empty;ISeq.empty]]
+ let conEmptySeq = ISeq.concat emptySeqs
+ let expectedEmptySeq =iseq <| seq { for i in 1..4 do yield ISeq.empty}
+
+ VerifySeqsEqual expectedEmptySeq conEmptySeq
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.concat nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.CountBy() =
+ // integer ISeq
+ let funcIntCount_by (x:int) = x%3
+ let seqInt =
+ iseq <| seq { for i in 0..9 do
+ yield i}
+ let countIntSeq = ISeq.countByVal funcIntCount_by seqInt
+
+ let expectedIntSeq = iseq [0,4;1,3;2,3]
+
+ VerifySeqsEqual expectedIntSeq countIntSeq
+
+ // string ISeq
+ let funcStrCount_by (s:string) = s.IndexOf("key")
+ let strSeq = iseq [ "key";"blank key";"key";"blank blank key"]
+
+ let countStrSeq = ISeq.countByVal funcStrCount_by strSeq
+ let expectedStrSeq = iseq [0,2;6,1;12,1]
+ VerifySeqsEqual expectedStrSeq countStrSeq
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let countEmptySeq = ISeq.countByVal funcIntCount_by emptySeq
+ let expectedEmptySeq =iseq []
+
+ VerifySeqsEqual expectedEmptySeq countEmptySeq
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.countBy funcIntCount_by nullSeq |> ignore)
+ ()
+
+ []
+ member this.Distinct() =
+
+ // integer ISeq
+ let IntDistinctSeq =
+ iseq <| seq { for i in 0..9 do
+ yield i % 3 }
+
+ let DistinctIntSeq = ISeq.distinct IntDistinctSeq
+
+ let expectedIntSeq = iseq [0;1;2]
+
+ VerifySeqsEqual expectedIntSeq DistinctIntSeq
+
+ // string ISeq
+ let strDistinctSeq = iseq ["elementDup"; "ele1"; "ele2"; "elementDup"]
+
+ let DistnctStrSeq = ISeq.distinct strDistinctSeq
+ let expectedStrSeq = iseq ["elementDup"; "ele1"; "ele2"]
+ VerifySeqsEqual expectedStrSeq DistnctStrSeq
+
+ // Empty ISeq
+ let emptySeq : iseq = ISeq.empty
+ let distinctEmptySeq : iseq = ISeq.distinct emptySeq
+ let expectedEmptySeq : iseq = iseq []
+
+ VerifySeqsEqual expectedEmptySeq distinctEmptySeq
+
+ //// null ISeq
+ //let nullSeq:iseq = null
+
+ //CheckThrowsArgumentNullException(fun () -> ISeq.distinct nullSeq |> ignore)
+ ()
+
+ []
+ member this.DistinctBy () =
+ // integer ISeq
+ let funcInt x = x % 3
+ let IntDistinct_bySeq =
+ iseq <| seq { for i in 0..9 do
+ yield i }
+
+ let distinct_byIntSeq = ISeq.distinctBy funcInt IntDistinct_bySeq
+
+ let expectedIntSeq = iseq [0;1;2]
+
+ VerifySeqsEqual expectedIntSeq distinct_byIntSeq
+
+ // string ISeq
+ let funcStrDistinct (s:string) = s.IndexOf("key")
+ let strSeq = iseq [ "key"; "blank key"; "key dup"; "blank key dup"]
+
+ let DistnctStrSeq = ISeq.distinctBy funcStrDistinct strSeq
+ let expectedStrSeq = iseq ["key"; "blank key"]
+ VerifySeqsEqual expectedStrSeq DistnctStrSeq
+
+ // Empty ISeq
+ let emptySeq : iseq = ISeq.empty
+ let distinct_byEmptySeq : iseq = ISeq.distinctBy funcInt emptySeq
+ let expectedEmptySeq : iseq = iseq []
+
+ VerifySeqsEqual expectedEmptySeq distinct_byEmptySeq
+
+ //// null ISeq
+ //let nullSeq : iseq<'a> = null
+
+ //CheckThrowsArgumentNullException(fun () -> ISeq.distinctBy funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.Except() =
+ // integer ISeq
+ let intSeq1 = iseq <| seq { yield! {1..100}
+ yield! {1..100} }
+ let intSeq2 = {1..10}
+ let expectedIntSeq = {11..100}
+
+ VerifySeqsEqual expectedIntSeq <| ISeq.except intSeq2 intSeq1
+
+ // string ISeq
+ let strSeq1 = iseq ["a"; "b"; "c"; "d"; "a"]
+ let strSeq2 = iseq ["b"; "c"]
+ let expectedStrSeq = iseq ["a"; "d"]
+
+ VerifySeqsEqual expectedStrSeq <| ISeq.except strSeq2 strSeq1
+
+ // double ISeq
+ // Sequences with nan do not behave, due to the F# generic equality comparisons
+// let floatSeq1 = iseq [1.0; 1.0; System.Double.MaxValue; nan; nan]
+//
+// VerifySeqsEqual [1.0; System.Double.MaxValue; nan; nan] <| ISeq.except [] floatSeq1
+// VerifySeqsEqual [1.0; System.Double.MaxValue] <| ISeq.except [nan] floatSeq1
+
+ // empty ISeq
+ let emptyIntSeq = ISeq.empty
+ VerifySeqsEqual {1..100} <| ISeq.except emptyIntSeq intSeq1
+ VerifySeqsEqual emptyIntSeq <| ISeq.except intSeq1 emptyIntSeq
+ VerifySeqsEqual emptyIntSeq <| ISeq.except emptyIntSeq emptyIntSeq
+ VerifySeqsEqual emptyIntSeq <| ISeq.except intSeq1 intSeq1
+
+ //// null ISeq
+ //let nullSeq : iseq = null
+ //CheckThrowsArgumentNullException(fun () -> ISeq.except nullSeq emptyIntSeq |> ignore)
+ //CheckThrowsArgumentNullException(fun () -> ISeq.except emptyIntSeq nullSeq |> ignore)
+ //CheckThrowsArgumentNullException(fun () -> ISeq.except nullSeq nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Exists() =
+
+ // Integer ISeq
+ let funcInt x = (x % 2 = 0)
+ let IntexistsSeq =
+ iseq <| seq { for i in 0..9 do
+ yield i}
+
+ let ifExistInt = ISeq.exists funcInt IntexistsSeq
+
+ Assert.IsTrue( ifExistInt)
+
+ // String ISeq
+ let funcStr (s:string) = s.Contains("key")
+ let strSeq = iseq ["key"; "blank key"]
+
+ let ifExistStr = ISeq.exists funcStr strSeq
+
+ Assert.IsTrue( ifExistStr)
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let ifExistsEmpty = ISeq.exists funcInt emptySeq
+
+ Assert.IsFalse( ifExistsEmpty)
+
+
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.exists funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.Exists2() =
+ // Integer ISeq
+ let funcInt x y = (x+y)%3=0
+ let Intexists2Seq1 = iseq [1;3;7]
+ let Intexists2Seq2 = iseq [1;6;3]
+
+ let ifExist2Int = ISeq.exists2 funcInt Intexists2Seq1 Intexists2Seq2
+ Assert.IsTrue( ifExist2Int)
+
+ // String ISeq
+ let funcStr s1 s2 = ((s1 + s2) = "CombinedString")
+ let strSeq1 = iseq [ "Combined"; "Not Combined"]
+ let strSeq2 = iseq ["String"; "Other String"]
+ let ifexists2Str = ISeq.exists2 funcStr strSeq1 strSeq2
+ Assert.IsTrue(ifexists2Str)
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let ifexists2Empty = ISeq.exists2 funcInt emptySeq emptySeq
+ Assert.IsFalse( ifexists2Empty)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.exists2 funcInt nullSeq nullSeq |> ignore)
+ ()
+
+
+ []
+ member this.Filter() =
+ // integer ISeq
+ let funcInt x = if (x % 5 = 0) then true else false
+ let IntSeq =
+ iseq <| seq { for i in 1..20 do
+ yield i }
+
+ let filterIntSeq = ISeq.filter funcInt IntSeq
+
+ let expectedfilterInt = iseq [ 5;10;15;20]
+
+ VerifySeqsEqual expectedfilterInt filterIntSeq
+
+ // string ISeq
+ let funcStr (s:string) = s.Contains("Expected Content")
+ let strSeq = iseq [ "Expected Content"; "Not Expected"; "Expected Content"; "Not Expected"]
+
+ let filterStrSeq = ISeq.filter funcStr strSeq
+
+ let expectedfilterStr = iseq ["Expected Content"; "Expected Content"]
+
+ VerifySeqsEqual expectedfilterStr filterStrSeq
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let filterEmptySeq = ISeq.filter funcInt emptySeq
+
+ let expectedEmptySeq =iseq []
+
+ VerifySeqsEqual expectedEmptySeq filterEmptySeq
+
+
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.filter funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.Find() =
+
+ // integer ISeq
+ let funcInt x = if (x % 5 = 0) then true else false
+ let IntSeq =
+ iseq <| seq { for i in 1..20 do
+ yield i }
+
+ let findInt = ISeq.find funcInt IntSeq
+ Assert.AreEqual(findInt, 5)
+
+ // string ISeq
+ let funcStr (s:string) = s.Contains("Expected Content")
+ let strSeq = iseq [ "Expected Content";"Not Expected"]
+
+ let findStr = ISeq.find funcStr strSeq
+ Assert.AreEqual(findStr, "Expected Content")
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+
+ CheckThrowsKeyNotFoundException(fun () -> ISeq.find funcInt emptySeq |> ignore)
+
+ // null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.find funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.FindBack() =
+ // integer ISeq
+ let funcInt x = x % 5 = 0
+ Assert.AreEqual(20, ISeq.findBack funcInt <| (iseq <| seq { 1..20 }))
+ Assert.AreEqual(15, ISeq.findBack funcInt <| (iseq <| seq { 1..19 }))
+ Assert.AreEqual(5, ISeq.findBack funcInt <| (iseq <| seq { 5..9 }))
+
+ // string ISeq
+ let funcStr (s:string) = s.Contains("Expected")
+ let strSeq = iseq [ "Not Expected"; "Expected Content"]
+ let findStr = ISeq.findBack funcStr strSeq
+ Assert.AreEqual("Expected Content", findStr)
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ CheckThrowsKeyNotFoundException(fun () -> ISeq.findBack funcInt emptySeq |> ignore)
+
+ // Not found
+ let emptySeq = ISeq.empty
+ CheckThrowsKeyNotFoundException(fun () -> iseq <| seq { 1..20 } |> ISeq.findBack (fun _ -> false) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.findBack funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.FindIndex() =
+
+ // integer ISeq
+ let digits = [1 .. 100] |> ISeq.ofList
+ let idx = digits |> ISeq.findIndex (fun i -> i.ToString().Length > 1)
+ Assert.AreEqual(idx, 9)
+
+ // empty ISeq
+ CheckThrowsKeyNotFoundException(fun () -> ISeq.findIndex (fun i -> true) ISeq.empty |> ignore)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.findIndex (fun i -> true) null |> ignore)
+ ()
+
+ []
+ member this.Permute() =
+ let mapIndex i = (i + 1) % 4
+
+ // integer iseq
+ let intSeq = iseq <| seq { 1..4 }
+ let resultInt = ISeq.permute mapIndex intSeq
+ VerifySeqsEqual (iseq [4;1;2;3]) resultInt
+
+ // string iseq
+ let resultStr = ISeq.permute mapIndex (iseq [|"Lists"; "are"; "commonly"; "list" |])
+ VerifySeqsEqual (iseq ["list"; "Lists"; "are"; "commonly" ]) resultStr
+
+ // empty iseq
+ let resultEpt = ISeq.permute mapIndex (iseq [||])
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null iseq
+ //let nullSeq = null:string[]
+ //CheckThrowsArgumentNullException (fun () -> ISeq.permute mapIndex nullSeq |> ignore)
+
+ // argument exceptions
+ CheckThrowsArgumentException (fun () -> ISeq.permute (fun _ -> 10) (iseq [0..9]) |> ISeq.iter ignore)
+ CheckThrowsArgumentException (fun () -> ISeq.permute (fun _ -> 0) (iseq [0..9]) |> ISeq.iter ignore)
+ ()
+
+ []
+ member this.FindIndexBack() =
+ // integer ISeq
+ let digits = iseq <| seq { 1..100 }
+ let idx = digits |> ISeq.findIndexBack (fun i -> i.ToString().Length = 1)
+ Assert.AreEqual(idx, 8)
+
+ // string ISeq
+ let funcStr (s:string) = s.Contains("Expected")
+ let strSeq = iseq [ "Not Expected"; "Expected Content" ]
+ let findStr = ISeq.findIndexBack funcStr strSeq
+ Assert.AreEqual(1, findStr)
+
+ // empty ISeq
+ CheckThrowsKeyNotFoundException(fun () -> ISeq.findIndexBack (fun i -> true) ISeq.empty |> ignore)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.findIndexBack (fun i -> true) null |> ignore)
+ ()
+
+ []
+ member this.Pick() =
+
+ let digits = [| 1 .. 10 |] |> ISeq.ofArray
+ let result = ISeq.pick (fun i -> if i > 5 then Some(i.ToString()) else None) digits
+ Assert.AreEqual(result, "6")
+
+ // Empty iseq (Bugged, 4173)
+ CheckThrowsKeyNotFoundException (fun () -> ISeq.pick (fun i -> Some('a')) (iseq ([| |] : int[])) |> ignore)
+
+ //// Null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.pick (fun i -> Some(i + 0)) null |> ignore)
+ ()
+
+ []
+ member this.Fold() =
+ let funcInt x y = x+y
+
+ let IntSeq =
+ iseq <| seq { for i in 1..10 do
+ yield i}
+
+ let foldInt = ISeq.fold funcInt 1 IntSeq
+ if foldInt <> 56 then Assert.Fail()
+
+ // string ISeq
+ let funcStr (x:string) (y:string) = x+y
+ let strSeq = iseq ["B"; "C"; "D" ; "E"]
+ let foldStr = ISeq.fold funcStr "A" strSeq
+
+ if foldStr <> "ABCDE" then Assert.Fail()
+
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let foldEmpty = ISeq.fold funcInt 1 emptySeq
+ if foldEmpty <> 1 then Assert.Fail()
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.fold funcInt 1 nullSeq |> ignore)
+ ()
+
+
+
+ []
+ member this.Fold2() =
+ Assert.AreEqual([(3,5); (2,3); (1,1)],ISeq.fold2 (fun acc x y -> (x,y)::acc) [] (iseq [ 1..3 ]) (iseq [1..2..6]))
+
+ // integer List
+ let funcInt x y z = x + y + z
+ let resultInt = ISeq.fold2 funcInt 9 (iseq [ 1..10 ]) (iseq [1..2..20])
+ Assert.AreEqual(164, resultInt)
+
+ // string List
+ let funcStr x y z = x + y + z
+ let resultStr = ISeq.fold2 funcStr "*" (iseq ["a"; "b"; "c" ; "d" ]) (iseq ["A"; "B"; "C" ; "D" ] )
+ Assert.AreEqual("*aAbBcCdD", resultStr)
+
+ // empty List
+ let emptyArr:int list = [ ]
+ let resultEpt = ISeq.fold2 funcInt 5 (iseq emptyArr) (iseq emptyArr)
+ Assert.AreEqual(5, resultEpt)
+
+ Assert.AreEqual(0,ISeq.fold2 funcInt 0 ISeq.empty (iseq [1]))
+ Assert.AreEqual(-1,ISeq.fold2 funcInt -1 (iseq [1]) ISeq.empty)
+
+ Assert.AreEqual(2,ISeq.fold2 funcInt 0 (iseq [1;2]) (iseq [1]))
+ Assert.AreEqual(4,ISeq.fold2 funcInt 0 (iseq [1]) (iseq [3;6]))
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.fold2 funcInt 0 nullSeq (iseq [1]) |> ignore)
+ //CheckThrowsArgumentNullException (fun () -> ISeq.fold2 funcInt 0 (iseq [1]) nullSeq |> ignore)
+ ()
+
+ []
+ member this.FoldBack() =
+ // int ISeq
+ let funcInt x y = x-y
+ let IntSeq = iseq <| seq { 1..4 }
+ let foldInt = ISeq.foldBack funcInt IntSeq 6
+ Assert.AreEqual((1-(2-(3-(4-6)))), foldInt)
+
+ // string ISeq
+ let funcStr (x:string) (y:string) = y.Remove(0,x.Length)
+ let strSeq = iseq [ "A"; "B"; "C"; "D" ]
+ let foldStr = ISeq.foldBack funcStr strSeq "ABCDE"
+ Assert.AreEqual("E", foldStr)
+
+ // single element
+ let funcStr2 elem acc = sprintf "%s%s" elem acc
+ let strSeq2 = iseq [ "A" ]
+ let foldStr2 = ISeq.foldBack funcStr2 strSeq2 "X"
+ Assert.AreEqual("AX", foldStr2)
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let foldEmpty = ISeq.foldBack funcInt emptySeq 1
+ Assert.AreEqual(1, foldEmpty)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.foldBack funcInt nullSeq 1 |> ignore)
+
+ // Validate that foldBack with the cons operator and the empty list returns a copy of the sequence
+ let cons x y = x :: y
+ let identityFoldr = ISeq.foldBack cons IntSeq []
+ Assert.AreEqual([1;2;3;4], identityFoldr)
+
+ ()
+
+ []
+ member this.foldBack2() =
+ // int ISeq
+ let funcInt x y z = x + y + z
+ let intSeq = iseq <| seq { 1..10 }
+ let resultInt = ISeq.foldBack2 funcInt intSeq (iseq <| seq { 1..2..20 }) 9
+ Assert.AreEqual(164, resultInt)
+
+ // string ISeq
+ let funcStr = sprintf "%s%s%s"
+ let strSeq = iseq [ "A"; "B"; "C"; "D" ]
+ let resultStr = ISeq.foldBack2 funcStr strSeq (iseq [ "a"; "b"; "c"; "d"]) "*"
+ Assert.AreEqual("AaBbCcDd*", resultStr)
+
+ // single element
+ let strSeqSingle = iseq [ "X" ]
+ Assert.AreEqual("XAZ", ISeq.foldBack2 funcStr strSeqSingle strSeq "Z")
+ Assert.AreEqual("AXZ", ISeq.foldBack2 funcStr strSeq strSeqSingle "Z")
+ Assert.AreEqual("XYZ", ISeq.foldBack2 funcStr strSeqSingle (iseq [ "Y" ]) "Z")
+
+ // empty ISeq
+ let emptySeq = ISeq.empty
+ Assert.AreEqual(1, ISeq.foldBack2 funcInt emptySeq emptySeq 1)
+ Assert.AreEqual(1, ISeq.foldBack2 funcInt emptySeq intSeq 1)
+ Assert.AreEqual(1, ISeq.foldBack2 funcInt intSeq emptySeq 1)
+
+ // infinite ISeq
+ let infiniteSeq = ISeq.initInfinite (fun i -> 2 * i + 1)
+ Assert.AreEqual(164, ISeq.foldBack2 funcInt intSeq infiniteSeq 9)
+ Assert.AreEqual(164, ISeq.foldBack2 funcInt infiniteSeq intSeq 9)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.foldBack2 funcInt nullSeq intSeq 1 |> ignore)
+ //CheckThrowsArgumentNullException (fun () -> ISeq.foldBack2 funcInt intSeq nullSeq 1 |> ignore)
+ //CheckThrowsArgumentNullException (fun () -> ISeq.foldBack2 funcInt nullSeq nullSeq 1 |> ignore)
+
+ ()
+
+ []
+ member this.ForAll() =
+
+ let funcInt x = if x%2 = 0 then true else false
+ let IntSeq =
+ iseq <| seq { for i in 1..10 do
+ yield i*2}
+ let for_allInt = ISeq.forall funcInt IntSeq
+
+ if for_allInt <> true then Assert.Fail()
+
+
+ // string ISeq
+ let funcStr (x:string) = x.Contains("a")
+ let strSeq = iseq ["a"; "ab"; "abc" ; "abcd"]
+ let for_allStr = ISeq.forall funcStr strSeq
+
+ if for_allStr <> true then Assert.Fail()
+
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let for_allEmpty = ISeq.forall funcInt emptySeq
+
+ if for_allEmpty <> true then Assert.Fail()
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.forall funcInt nullSeq |> ignore)
+ ()
+
+ []
+ member this.ForAll2() =
+
+ let funcInt x y = if (x+y)%2 = 0 then true else false
+ let IntSeq =
+ iseq <| seq { for i in 1..10 do
+ yield i}
+
+ let for_all2Int = ISeq.forall2 funcInt IntSeq IntSeq
+
+ if for_all2Int <> true then Assert.Fail()
+
+ // string ISeq
+ let funcStr (x:string) (y:string) = (x+y).Length = 5
+ let strSeq1 = iseq ["a"; "ab"; "abc" ; "abcd"]
+ let strSeq2 = iseq ["abcd"; "abc"; "ab" ; "a"]
+ let for_all2Str = ISeq.forall2 funcStr strSeq1 strSeq2
+
+ if for_all2Str <> true then Assert.Fail()
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let for_all2Empty = ISeq.forall2 funcInt emptySeq emptySeq
+
+ if for_all2Empty <> true then Assert.Fail()
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.forall2 funcInt nullSeq nullSeq |> ignore)
+
+ []
+ member this.GroupBy() =
+
+ let funcInt x = x%5
+
+ let IntSeq =
+ iseq <| seq { for i in 0 .. 9 do
+ yield i }
+
+ let group_byInt = ISeq.groupByVal funcInt IntSeq |> ISeq.map (fun (i, v) -> i, ISeq.toList v)
+
+ let expectedIntSeq =
+ iseq <| seq { for i in 0..4 do
+ yield i, [i; i+5] }
+
+ VerifySeqsEqual group_byInt expectedIntSeq
+
+ // string ISeq
+ let funcStr (x:string) = x.Length
+ let strSeq = iseq ["length7"; "length 8"; "length7" ; "length 9"]
+
+ let group_byStr = ISeq.groupByVal funcStr strSeq |> ISeq.map (fun (i, v) -> i, ISeq.toList v)
+ let expectedStrSeq =
+ iseq <| seq {
+ yield 7, ["length7"; "length7"]
+ yield 8, ["length 8"]
+ yield 9, ["length 9"] }
+
+ VerifySeqsEqual expectedStrSeq group_byStr
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let group_byEmpty = ISeq.groupByVal funcInt emptySeq
+ let expectedEmptySeq = iseq []
+
+ VerifySeqsEqual expectedEmptySeq group_byEmpty
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //let group_byNull = ISeq.groupBy funcInt nullSeq
+ //CheckThrowsArgumentNullException (fun () -> ISeq.iter (fun _ -> ()) group_byNull)
+ ()
+
+ []
+ member this.DisposalOfUnstartedEnumerator() =
+ let run = ref false
+ let f() = iseq <| seq {
+ try
+ ()
+ finally
+ run := true
+ }
+
+ f().GetEnumerator().Dispose()
+ Assert.IsFalse(!run)
+
+ []
+ member this.WeirdLocalNames() =
+
+ let f pc = iseq <| seq {
+ yield pc
+ yield (pc+1)
+ yield (pc+2)
+ }
+
+ let l = f 3 |> ISeq.toList
+ Assert.AreEqual([3;4;5], l)
+
+ let f i = iseq <| seq {
+ let pc = i*2
+ yield pc
+ yield (pc+1)
+ yield (pc+2)
+ }
+ let l = f 3 |> ISeq.toList
+ Assert.AreEqual([6;7;8], l)
+
+ []
+ member this.Contains() =
+
+ // Integer ISeq
+ let intSeq = iseq <| seq { 0..9 }
+
+ let ifContainsInt = ISeq.contains 5 intSeq
+
+ Assert.IsTrue(ifContainsInt)
+
+ // String ISeq
+ let strSeq = iseq ["key"; "blank key"]
+
+ let ifContainsStr = ISeq.contains "key" strSeq
+
+ Assert.IsTrue(ifContainsStr)
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ let ifContainsEmpty = ISeq.contains 5 emptySeq
+
+ Assert.IsFalse(ifContainsEmpty)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.contains 5 nullSeq |> ignore)
diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule2.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule2.fs
new file mode 100644
index 00000000000..e6a16911496
--- /dev/null
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqModule2.fs
@@ -0,0 +1,1841 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Collections
+
+open System
+open NUnit.Framework
+
+open FSharp.Core.Unittests.LibraryTestFx
+
+//type iseq<'a> = ISeq.Core.ISeq<'a>
+
+type ISeqWindowedTestInput<'t> =
+ {
+ InputSeq : iseq<'t>
+ WindowSize : int
+ ExpectedSeq : iseq<'t[]>
+ Exception : Type option
+ }
+
+[]
+type ISeqModule2() =
+ let iseq (x:seq<_>) = x |> ISeq.ofSeq
+
+ []
+ member this.Hd() =
+
+ let IntSeq =
+ iseq <| seq { for i in 0 .. 9 do
+ yield i }
+
+ if ISeq.head IntSeq <> 0 then Assert.Fail()
+
+ // string ISeq
+ let strSeq = iseq ["first"; "second"; "third"]
+ if ISeq.head strSeq <> "first" then Assert.Fail()
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ CheckThrowsArgumentException ( fun() -> ISeq.head emptySeq)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.head nullSeq)
+ ()
+
+ []
+ member this.TryHead() =
+ // int ISeq
+ let IntSeq =
+ iseq <| seq { for i in 0 .. 9 -> i }
+
+ let intResult = ISeq.tryHead IntSeq
+
+ // string ISeq
+ let strResult = ISeq.tryHead (iseq ["first"; "second"; "third"])
+ Assert.AreEqual("first", strResult.Value)
+
+ // Empty ISeq
+ let emptyResult = ISeq.tryHead ISeq.empty
+ Assert.AreEqual(None, emptyResult)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.head nullSeq)
+ ()
+
+ []
+ member this.Tl() =
+ // integer iseq
+ let resultInt = ISeq.tail <| (iseq <| seq { 1..10 } )
+ Assert.AreEqual(Array.ofSeq (iseq <| seq { 2..10 }), Array.ofSeq resultInt)
+
+ // string iseq
+ let resultStr = ISeq.tail <| (iseq <| seq { yield "a"; yield "b"; yield "c"; yield "d" })
+ Assert.AreEqual(Array.ofSeq (iseq <| seq { yield "b"; yield "c" ; yield "d" }), Array.ofSeq resultStr)
+
+ // 1-element iseq
+ let resultStr2 = ISeq.tail <| (iseq <| seq { yield "a" })
+ Assert.AreEqual(Array.ofSeq (ISeq.empty : iseq), Array.ofSeq resultStr2)
+
+ //CheckThrowsArgumentNullException(fun () -> ISeq.tail null |> ignore)
+ CheckThrowsArgumentException(fun () -> ISeq.tail ISeq.empty |> ISeq.iter (fun _ -> failwith "Should not be reached"))
+ ()
+
+ []
+ member this.Last() =
+
+ let IntSeq =
+ iseq <| seq { for i in 0 .. 9 do
+ yield i }
+
+ if ISeq.last IntSeq <> 9 then Assert.Fail()
+
+ // string ISeq
+ let strSeq = iseq ["first"; "second"; "third"]
+ if ISeq.last strSeq <> "third" then Assert.Fail()
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ CheckThrowsArgumentException ( fun() -> ISeq.last emptySeq)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.last nullSeq)
+ ()
+
+ []
+ member this.TryLast() =
+
+ let IntSeq =
+ iseq <| seq { for i in 0 .. 9 -> i }
+
+ let intResult = ISeq.tryLast IntSeq
+ Assert.AreEqual(9, intResult.Value)
+
+ // string ISeq
+ let strResult = ISeq.tryLast (iseq ["first"; "second"; "third"])
+ Assert.AreEqual("third", strResult.Value)
+
+ // Empty ISeq
+ let emptyResult = ISeq.tryLast ISeq.empty
+ Assert.IsTrue(emptyResult.IsNone)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.tryLast nullSeq |> ignore)
+ ()
+
+ []
+ member this.ExactlyOne() =
+
+ let IntSeq =
+ iseq <| seq { for i in 7 .. 7 do
+ yield i }
+
+ if ISeq.exactlyOne IntSeq <> 7 then Assert.Fail()
+
+ // string ISeq
+ let strSeq = iseq ["second"]
+ if ISeq.exactlyOne strSeq <> "second" then Assert.Fail()
+
+ // Empty ISeq
+ let emptySeq = ISeq.empty
+ CheckThrowsArgumentException ( fun() -> ISeq.exactlyOne emptySeq)
+
+ // non-singleton ISeq
+ let emptySeq = ISeq.empty
+ CheckThrowsArgumentException ( fun() -> ISeq.exactlyOne (iseq [ 0 .. 1 ]) |> ignore )
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.exactlyOne nullSeq)
+ ()
+
+
+ []
+ member this.Init() =
+
+ let funcInt x = x
+ let init_finiteInt = ISeq.init 9 funcInt
+ let expectedIntSeq = iseq [ 0..8]
+
+ VerifySeqsEqual expectedIntSeq init_finiteInt
+
+
+ // string ISeq
+ let funcStr x = x.ToString()
+ let init_finiteStr = ISeq.init 5 funcStr
+ let expectedStrSeq = iseq ["0";"1";"2";"3";"4"]
+
+ VerifySeqsEqual expectedStrSeq init_finiteStr
+
+ // null ISeq
+ let funcNull x = null
+ let init_finiteNull = ISeq.init 3 funcNull
+ let expectedNullSeq = iseq [ null;null;null]
+
+ VerifySeqsEqual expectedNullSeq init_finiteNull
+ ()
+
+ []
+ member this.InitInfinite() =
+
+ let funcInt x = x
+ let init_infiniteInt = ISeq.initInfinite funcInt
+ let resultint = ISeq.find (fun x -> x =100) init_infiniteInt
+
+ Assert.AreEqual(100,resultint)
+
+
+ // string ISeq
+ let funcStr x = x.ToString()
+ let init_infiniteStr = ISeq.initInfinite funcStr
+ let resultstr = ISeq.find (fun x -> x = "100") init_infiniteStr
+
+ Assert.AreEqual("100",resultstr)
+
+
+ []
+ member this.IsEmpty() =
+
+ //iseq int
+ let seqint = iseq [1;2;3]
+ let is_emptyInt = ISeq.isEmpty seqint
+
+ Assert.IsFalse(is_emptyInt)
+
+ //iseq str
+ let seqStr = iseq["first";"second"]
+ let is_emptyStr = ISeq.isEmpty seqStr
+
+ Assert.IsFalse(is_emptyInt)
+
+ //iseq empty
+ let seqEmpty = ISeq.empty
+ let is_emptyEmpty = ISeq.isEmpty seqEmpty
+ Assert.IsTrue(is_emptyEmpty)
+
+ ////iseq null
+ //let seqnull:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.isEmpty seqnull |> ignore)
+ ()
+
+ []
+ member this.Iter() =
+ //iseq int
+ let seqint = iseq [ 1..3]
+ let cacheint = ref 0
+
+ let funcint x = cacheint := !cacheint + x
+ ISeq.iter funcint seqint
+ Assert.AreEqual(6,!cacheint)
+
+ //iseq str
+ let seqStr = iseq ["first";"second"]
+ let cachestr =ref ""
+ let funcstr x = cachestr := !cachestr+x
+ ISeq.iter funcstr seqStr
+
+ Assert.AreEqual("firstsecond",!cachestr)
+
+ // empty array
+ let emptyseq = ISeq.empty
+ let resultEpt = ref 0
+ ISeq.iter (fun x -> Assert.Fail()) emptyseq
+
+ //// null seqay
+ //let nullseq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.iter funcint nullseq |> ignore)
+ ()
+
+ []
+ member this.Iter2() =
+
+ //iseq int
+ let seqint = iseq [ 1..3]
+ let cacheint = ref 0
+
+ let funcint x y = cacheint := !cacheint + x+y
+ ISeq.iter2 funcint seqint seqint
+ Assert.AreEqual(12,!cacheint)
+
+ //iseq str
+ let seqStr = iseq ["first";"second"]
+ let cachestr =ref ""
+ let funcstr x y = cachestr := !cachestr+x+y
+ ISeq.iter2 funcstr seqStr seqStr
+
+ Assert.AreEqual("firstfirstsecondsecond",!cachestr)
+
+ // empty array
+ let emptyseq = ISeq.empty
+ let resultEpt = ref 0
+ ISeq.iter2 (fun x y-> Assert.Fail()) emptyseq emptyseq
+
+ //// null seqay
+ //let nullseq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.iter2 funcint nullseq nullseq |> ignore)
+
+ ()
+
+ []
+ member this.Iteri() =
+
+ // iseq int
+ let seqint = iseq [ 1..10]
+ let cacheint = ref 0
+
+ let funcint x y = cacheint := !cacheint + x+y
+ ISeq.iteri funcint seqint
+ Assert.AreEqual(100,!cacheint)
+
+ // iseq str
+ let seqStr = iseq ["first";"second"]
+ let cachestr =ref 0
+ let funcstr (x:int) (y:string) = cachestr := !cachestr+ x + y.Length
+ ISeq.iteri funcstr seqStr
+
+ Assert.AreEqual(12,!cachestr)
+
+ // empty array
+ let emptyseq = ISeq.empty
+ let resultEpt = ref 0
+ ISeq.iteri funcint emptyseq
+ Assert.AreEqual(0,!resultEpt)
+
+ //// null seqay
+ //let nullseq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.iteri funcint nullseq |> ignore)
+ ()
+
+ []
+ member this.Iteri2() =
+
+ //iseq int
+ let seqint = iseq [ 1..3]
+ let cacheint = ref 0
+
+ let funcint x y z = cacheint := !cacheint + x + y + z
+ ISeq.iteri2 funcint seqint seqint
+ Assert.AreEqual(15,!cacheint)
+
+ //iseq str
+ let seqStr = iseq ["first";"second"]
+ let cachestr = ref 0
+ let funcstr (x:int) (y:string) (z:string) = cachestr := !cachestr + x + y.Length + z.Length
+ ISeq.iteri2 funcstr seqStr seqStr
+
+ Assert.AreEqual(23,!cachestr)
+
+ // empty iseq
+ let emptyseq = ISeq.empty
+ let resultEpt = ref 0
+ ISeq.iteri2 (fun x y z -> Assert.Fail()) emptyseq emptyseq
+
+ //// null iseq
+ //let nullseq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.iteri2 funcint nullseq nullseq |> ignore)
+
+ // len1 <> len2
+ let shorterSeq = iseq <| seq { 1..3 }
+ let longerSeq = iseq <| seq { 2..2..100 }
+
+ let testSeqLengths seq1 seq2 =
+ let cache = ref 0
+ let f x y z = cache := !cache + x + y + z
+ ISeq.iteri2 f seq1 seq2
+ !cache
+
+ Assert.AreEqual(21, testSeqLengths shorterSeq longerSeq)
+ Assert.AreEqual(21, testSeqLengths longerSeq shorterSeq)
+
+ ()
+
+ []
+ member this.Length() =
+
+ // integer iseq
+ let resultInt = ISeq.length (iseq {1..8})
+ if resultInt <> 8 then Assert.Fail()
+
+ // string ISeq
+ let resultStr = ISeq.length (iseq ["Lists"; "are"; "commonly" ; "list" ])
+ if resultStr <> 4 then Assert.Fail()
+
+ // empty ISeq
+ let resultEpt = ISeq.length ISeq.empty
+ if resultEpt <> 0 then Assert.Fail()
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.length nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Map() =
+
+ // integer ISeq
+ let funcInt x =
+ match x with
+ | _ when x % 2 = 0 -> 10*x
+ | _ -> x
+
+ let resultInt = ISeq.map funcInt (iseq { 1..10 })
+ let expectedint = iseq [1;20;3;40;5;60;7;80;9;100]
+
+ VerifySeqsEqual expectedint resultInt
+
+ // string ISeq
+ let funcStr (x:string) = x.ToLower()
+ let resultStr = ISeq.map funcStr (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ let expectedSeq = iseq ["lists"; "are"; "commonly" ; "list"]
+
+ VerifySeqsEqual expectedSeq resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.map funcInt ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.map funcStr nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Map2() =
+ // integer ISeq
+ let funcInt x y = x+y
+ let resultInt = ISeq.map2 funcInt (iseq { 1..10 }) (iseq {2..2..20})
+ let expectedint = iseq [3;6;9;12;15;18;21;24;27;30]
+
+ VerifySeqsEqual expectedint resultInt
+
+ // string ISeq
+ let funcStr (x:int) (y:string) = x+y.Length
+ let resultStr = ISeq.map2 funcStr (iseq[3;6;9;11]) (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ let expectedSeq = iseq [8;9;17;15]
+
+ VerifySeqsEqual expectedSeq resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.map2 funcInt ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //let validSeq = iseq [1]
+ //CheckThrowsArgumentNullException (fun () -> ISeq.map2 funcInt nullSeq validSeq |> ignore)
+
+ ()
+
+ []
+ member this.Map3() =
+ // Integer iseq
+ let funcInt a b c = (a + b) * c
+ let resultInt = ISeq.map3 funcInt (iseq { 1..8 }) (iseq { 2..9 }) (iseq { 3..10 })
+ let expectedInt = iseq [9; 20; 35; 54; 77; 104; 135; 170]
+ VerifySeqsEqual expectedInt resultInt
+
+ // First iseq is shorter
+ VerifySeqsEqual (iseq [9; 20]) (ISeq.map3 funcInt (iseq { 1..2 }) (iseq { 2..9 }) (iseq { 3..10 }))
+ // Second iseq is shorter
+ VerifySeqsEqual (iseq [9; 20; 35]) (ISeq.map3 funcInt (iseq { 1..8 }) (iseq { 2..4 }) (iseq { 3..10 }))
+ // Third iseq is shorter
+ VerifySeqsEqual (iseq [9; 20; 35; 54]) (ISeq.map3 funcInt (iseq { 1..8 }) (iseq { 2..6 }) (iseq { 3..6 }))
+
+ // String iseq
+ let funcStr a b c = a + b + c
+ let resultStr = ISeq.map3 funcStr (iseq ["A";"B";"C";"D"]) (iseq ["a";"b";"c";"d"]) (iseq ["1";"2";"3";"4"])
+ let expectedStr = iseq ["Aa1";"Bb2";"Cc3";"Dd4"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // Empty iseq
+ let resultEmpty = ISeq.map3 funcStr ISeq.empty ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEmpty
+
+ //// Null iseq
+ //let nullSeq = null : iseq<_>
+ //let nonNullSeq = iseq [1]
+ //CheckThrowsArgumentNullException (fun () -> ISeq.map3 funcInt nullSeq nonNullSeq nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.MapFold() =
+ // integer ISeq
+ let funcInt acc x = if x % 2 = 0 then 10*x, acc + 1 else x, acc
+ let resultInt,resultIntAcc = ISeq.mapFold funcInt 100 <| (iseq <| seq { 1..10 })
+ VerifySeqsEqual (iseq [ 1;20;3;40;5;60;7;80;9;100 ]) resultInt
+ Assert.AreEqual(105, resultIntAcc)
+
+ // string ISeq
+ let funcStr acc (x:string) = match x.Length with 0 -> "empty", acc | _ -> x.ToLower(), sprintf "%s%s" acc x
+ let resultStr,resultStrAcc = ISeq.mapFold funcStr "" <| iseq [ "";"BB";"C";"" ]
+ VerifySeqsEqual (iseq [ "empty";"bb";"c";"empty" ]) resultStr
+ Assert.AreEqual("BBC", resultStrAcc)
+
+ // empty ISeq
+ let resultEpt,resultEptAcc = ISeq.mapFold funcInt 100 ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+ Assert.AreEqual(100, resultEptAcc)
+
+ //// null ISeq
+ //let nullArr = null:iseq
+ //CheckThrowsArgumentNullException (fun () -> ISeq.mapFold funcStr "" nullArr |> ignore)
+
+ ()
+
+ []
+ member this.MapFoldBack() =
+ // integer ISeq
+ let funcInt x acc = if acc < 105 then 10*x, acc + 2 else x, acc
+ let resultInt,resultIntAcc = ISeq.mapFoldBack funcInt (iseq <| seq { 1..10 }) 100
+ VerifySeqsEqual (iseq [ 1;2;3;4;5;6;7;80;90;100 ]) resultInt
+ Assert.AreEqual(106, resultIntAcc)
+
+ // string ISeq
+ let funcStr (x:string) acc = match x.Length with 0 -> "empty", acc | _ -> x.ToLower(), sprintf "%s%s" acc x
+ let resultStr,resultStrAcc = ISeq.mapFoldBack funcStr (iseq [ "";"BB";"C";"" ]) ""
+ VerifySeqsEqual (iseq [ "empty";"bb";"c";"empty" ]) resultStr
+ Assert.AreEqual("CBB", resultStrAcc)
+
+ // empty ISeq
+ let resultEpt,resultEptAcc = ISeq.mapFoldBack funcInt ISeq.empty 100
+ VerifySeqsEqual ISeq.empty resultEpt
+ Assert.AreEqual(100, resultEptAcc)
+
+ //// null ISeq
+ //let nullArr = null:iseq
+ //CheckThrowsArgumentNullException (fun () -> ISeq.mapFoldBack funcStr nullArr "" |> ignore)
+
+ ()
+
+ member private this.MapWithSideEffectsTester (map : (int -> int) -> iseq -> iseq) expectExceptions =
+ let i = ref 0
+ let f x = i := !i + 1; x*x
+ let e = ((iseq [1;2]) |> map f).GetEnumerator()
+
+ if expectExceptions then
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(0, !i)
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ if expectExceptions then
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current |> ignore)
+ Assert.AreEqual(2, !i)
+
+
+ i := 0
+ let e = ((iseq []) |> map f).GetEnumerator()
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+
+
+ member private this.MapWithExceptionTester (map : (int -> int) -> iseq -> iseq) =
+ let raiser x = if x > 0 then raise(NotSupportedException()) else x
+ let e = (map raiser (iseq [0; 1])).GetEnumerator()
+ Assert.IsTrue(e.MoveNext()) // should not throw
+ Assert.AreEqual(0, e.Current)
+ CheckThrowsNotSupportedException(fun _ -> e.MoveNext() |> ignore)
+ Assert.AreEqual(0, e.Current) // should not throw
+
+ []
+ member this.MapWithSideEffects () =
+ this.MapWithSideEffectsTester ISeq.map true
+
+ []
+ member this.MapWithException () =
+ this.MapWithExceptionTester ISeq.map
+
+
+ []
+ member this.SingletonCollectWithSideEffects () =
+ this.MapWithSideEffectsTester (fun f-> ISeq.collect (f >> ISeq.singleton)) true
+
+ []
+ member this.SingletonCollectWithException () =
+ this.MapWithExceptionTester (fun f-> ISeq.collect (f >> ISeq.singleton))
+
+#if !FX_NO_LINQ
+ []
+ member this.SystemLinqSelectWithSideEffects () =
+ this.MapWithSideEffectsTester (fun f s -> iseq <| System.Linq.Enumerable.Select(s, Func<_,_>(f))) false
+
+ []
+ member this.SystemLinqSelectWithException () =
+ this.MapWithExceptionTester (fun f s -> iseq <| System.Linq.Enumerable.Select(s, Func<_,_>(f)))
+#endif
+
+ []
+ member this.MapiWithSideEffects () =
+ let i = ref 0
+ let f _ x = i := !i + 1; x*x
+ let e = ((iseq [1;2]) |> ISeq.mapi f).GetEnumerator()
+
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(0, !i)
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(2, !i)
+
+ i := 0
+ let e = ((iseq []) |> ISeq.mapi f).GetEnumerator()
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+
+ []
+ member this.Map2WithSideEffects () =
+ let i = ref 0
+ let f x y = i := !i + 1; x*x
+ let e = (ISeq.map2 f (iseq [1;2]) (iseq [1;2])).GetEnumerator()
+
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(0, !i)
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(2,!i)
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(2, !i)
+
+ i := 0
+ let e = (ISeq.map2 f (iseq []) (iseq [])).GetEnumerator()
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+
+ []
+ member this.Mapi2WithSideEffects () =
+ let i = ref 0
+ let f _ x y = i := !i + 1; x*x
+ let e = (ISeq.mapi2 f (iseq [1;2]) (iseq [1;2])).GetEnumerator()
+
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(0, !i)
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+ let _ = e.Current
+ Assert.AreEqual(1, !i)
+
+ if not (e.MoveNext()) then Assert.Fail()
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+ let _ = e.Current
+ Assert.AreEqual(2, !i)
+
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(2,!i)
+ CheckThrowsInvalidOperationExn (fun _ -> e.Current|>ignore)
+ Assert.AreEqual(2, !i)
+
+ i := 0
+ let e = (ISeq.mapi2 f (iseq []) (iseq [])).GetEnumerator()
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+ if e.MoveNext() then Assert.Fail()
+ Assert.AreEqual(0,!i)
+
+ []
+ member this.Collect() =
+ // integer ISeq
+ let funcInt x = iseq [x+1]
+ let resultInt = ISeq.collect funcInt (iseq { 1..10 })
+
+ let expectedint = iseq <| seq {2..11}
+
+ VerifySeqsEqual expectedint resultInt
+
+//#if !FX_NO_CHAR_PARSE
+// // string ISeq
+// let funcStr (y:string) = y+"ist"
+
+// let resultStr = ISeq.collect funcStr (iseq ["L"])
+
+
+// let expectedSeq = iseq ['L';'i';'s';'t']
+
+// VerifySeqsEqual expectedSeq resultStr
+//#endif
+ // empty ISeq
+ let resultEpt = ISeq.collect funcInt ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.collect funcInt nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Mapi() =
+
+ // integer ISeq
+ let funcInt x y = x+y
+ let resultInt = ISeq.mapi funcInt (iseq { 10..2..20 } )
+ let expectedint = iseq [10;13;16;19;22;25]
+
+ VerifySeqsEqual expectedint resultInt
+
+ // string ISeq
+ let funcStr (x:int) (y:string) =x+y.Length
+
+ let resultStr = ISeq.mapi funcStr (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ let expectedStr = iseq [5;4;10;7]
+
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.mapi funcInt ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+
+ //CheckThrowsArgumentNullException (fun () -> ISeq.mapi funcInt nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Mapi2() =
+ // integer ISeq
+ let funcInt x y z = x+y+z
+ let resultInt = ISeq.mapi2 funcInt (iseq { 1..10 }) (iseq {2..2..20})
+ let expectedint = iseq [3;7;11;15;19;23;27;31;35;39]
+
+ VerifySeqsEqual expectedint resultInt
+
+ // string ISeq
+ let funcStr (x:int) (y:int) (z:string) = x+y+z.Length
+ let resultStr = ISeq.mapi2 funcStr (iseq[3;6;9;11]) (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ let expectedSeq = iseq [8;10;19;18]
+
+ VerifySeqsEqual expectedSeq resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.mapi2 funcInt ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //let validSeq = iseq [1]
+ //CheckThrowsArgumentNullException (fun () -> ISeq.mapi2 funcInt nullSeq validSeq |> ignore)
+
+ // len1 <> len2
+ let shorterSeq = iseq <| seq { 1..10 }
+ let longerSeq = iseq <| seq { 2..20 }
+
+ let testSeqLengths seq1 seq2 =
+ let f x y z = x + y + z
+ ISeq.mapi2 f seq1 seq2
+
+ VerifySeqsEqual (iseq [3;6;9;12;15;18;21;24;27;30]) (testSeqLengths shorterSeq longerSeq)
+ VerifySeqsEqual (iseq [3;6;9;12;15;18;21;24;27;30]) (testSeqLengths longerSeq shorterSeq)
+
+ []
+ member this.Indexed() =
+
+ // integer ISeq
+ let resultInt = ISeq.indexed (iseq { 10..2..20 })
+ let expectedint = iseq [(0,10);(1,12);(2,14);(3,16);(4,18);(5,20)]
+
+ VerifySeqsEqual expectedint resultInt
+
+ // string ISeq
+ let resultStr = ISeq.indexed (iseq ["Lists"; "Are"; "Commonly"; "List" ])
+ let expectedStr = iseq [(0,"Lists");(1,"Are");(2,"Commonly");(3,"List")]
+
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.indexed ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.indexed nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Max() =
+ // integer ISeq
+ let resultInt = ISeq.max (iseq { 10..20 } )
+
+ Assert.AreEqual(20,resultInt)
+
+ // string ISeq
+
+ let resultStr = ISeq.max (iseq ["Lists"; "Are"; "MaxString" ; "List" ])
+ Assert.AreEqual("MaxString",resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException(fun () -> ISeq.max ( ISeq.empty : iseq) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.max nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.MaxBy() =
+
+ // integer ISeq
+ let funcInt x = x % 8
+ let resultInt = ISeq.maxBy funcInt (iseq { 2..2..20 } )
+ Assert.AreEqual(6,resultInt)
+
+ // string ISeq
+ let funcStr (x:string) =x.Length
+ let resultStr = ISeq.maxBy funcStr (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ Assert.AreEqual("Commonly",resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException (fun () -> ISeq.maxBy funcInt (ISeq.empty : iseq) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.maxBy funcInt nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.MinBy() =
+
+ // integer ISeq
+ let funcInt x = x % 8
+ let resultInt = ISeq.minBy funcInt (iseq { 2..2..20 } )
+ Assert.AreEqual(8,resultInt)
+
+ // string ISeq
+ let funcStr (x:string) =x.Length
+ let resultStr = ISeq.minBy funcStr (iseq ["Lists"; "Are"; "Commonly" ; "List" ])
+ Assert.AreEqual("Are",resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException (fun () -> ISeq.minBy funcInt (ISeq.empty : iseq) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.minBy funcInt nullSeq |> ignore)
+
+ ()
+
+
+ []
+ member this.Min() =
+
+ // integer ISeq
+ let resultInt = ISeq.min (iseq { 10..20 } )
+ Assert.AreEqual(10,resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.min (iseq ["Lists"; "Are"; "minString" ; "List" ])
+ Assert.AreEqual("Are",resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException (fun () -> ISeq.min (ISeq.empty : iseq) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.min nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Item() =
+ // integer ISeq
+ let resultInt = ISeq.item 3 (iseq { 10..20 })
+ Assert.AreEqual(13, resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.item 2 (iseq ["Lists"; "Are"; "Cool" ; "List" ])
+ Assert.AreEqual("Cool", resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException(fun () -> ISeq.item 0 (ISeq.empty : iseq) |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () ->ISeq.item 3 nullSeq |> ignore)
+
+ // Negative index
+ for i = -1 downto -10 do
+ CheckThrowsArgumentException (fun () -> ISeq.item i (iseq { 10 .. 20 }) |> ignore)
+
+ // Out of range
+ for i = 11 to 20 do
+ CheckThrowsArgumentException (fun () -> ISeq.item i (iseq { 10 .. 20 }) |> ignore)
+
+ []
+ member this.``item should fail with correct number of missing elements``() =
+ try
+ ISeq.item 0 (iseq (Array.zeroCreate 0)) |> ignore
+ failwith "error expected"
+ with
+ | exn when exn.Message.Contains("seq was short by 1 element") -> ()
+
+ try
+ ISeq.item 2 (iseq (Array.zeroCreate 0)) |> ignore
+ failwith "error expected"
+ with
+ | exn when exn.Message.Contains("seq was short by 3 elements") -> ()
+
+ []
+ member this.Of_Array() =
+ // integer ISeq
+ let resultInt = ISeq.ofArray [|1..10|]
+ let expectedInt = {1..10}
+
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr = ISeq.ofArray [|"Lists"; "Are"; "ofArrayString" ; "List" |]
+ let expectedStr = iseq ["Lists"; "Are"; "ofArrayString" ; "List" ]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.ofArray [| |]
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ ()
+
+ []
+ member this.Of_List() =
+ // integer ISeq
+ let resultInt = ISeq.ofList [1..10]
+ let expectedInt = {1..10}
+
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+
+ let resultStr =ISeq.ofList ["Lists"; "Are"; "ofListString" ; "List" ]
+ let expectedStr = iseq ["Lists"; "Are"; "ofListString" ; "List" ]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.ofList []
+ VerifySeqsEqual resultEpt ISeq.empty
+ ()
+
+
+ []
+ member this.Pairwise() =
+ // integer ISeq
+ let resultInt = ISeq.pairwise (iseq {1..3})
+
+ let expectedInt = iseq [1,2;2,3]
+
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.pairwise (iseq ["str1"; "str2";"str3" ])
+ let expectedStr = iseq ["str1","str2";"str2","str3"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.pairwise (iseq [] )
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ ()
+
+ []
+ member this.Reduce() =
+
+ // integer ISeq
+ let resultInt = ISeq.reduce (fun x y -> x/y) (iseq [5*4*3*2; 4;3;2;1])
+ Assert.AreEqual(5,resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.reduce (fun (x:string) (y:string) -> x.Remove(0,y.Length)) (iseq ["ABCDE";"A"; "B"; "C" ; "D" ])
+ Assert.AreEqual("E",resultStr)
+
+ // empty ISeq
+ CheckThrowsArgumentException (fun () -> ISeq.reduce (fun x y -> x/y) ISeq.empty |> ignore)
+
+ //// null ISeq
+ //let nullSeq : iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.reduce (fun (x:string) (y:string) -> x.Remove(0,y.Length)) nullSeq |> ignore)
+ ()
+
+ []
+ member this.ReduceBack() =
+ // int ISeq
+ let funcInt x y = x - y
+ let IntSeq = iseq <| seq { 1..4 }
+ let reduceInt = ISeq.reduceBack funcInt IntSeq
+ Assert.AreEqual((1-(2-(3-4))), reduceInt)
+
+ // string ISeq
+ let funcStr (x:string) (y:string) = y.Remove(0,x.Length)
+ let strSeq = iseq [ "A"; "B"; "C"; "D" ; "ABCDE" ]
+ let reduceStr = ISeq.reduceBack funcStr strSeq
+ Assert.AreEqual("E", reduceStr)
+
+ // string ISeq
+ let funcStr2 elem acc = sprintf "%s%s" elem acc
+ let strSeq2 = iseq [ "A" ]
+ let reduceStr2 = ISeq.reduceBack funcStr2 strSeq2
+ Assert.AreEqual("A", reduceStr2)
+
+ // Empty ISeq
+ CheckThrowsArgumentException (fun () -> ISeq.reduceBack funcInt ISeq.empty |> ignore)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.reduceBack funcInt nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.Rev() =
+ // integer ISeq
+ let resultInt = ISeq.rev (iseq [5;4;3;2;1])
+ VerifySeqsEqual (iseq[1;2;3;4;5]) resultInt
+
+ // string ISeq
+ let resultStr = ISeq.rev (iseq ["A"; "B"; "C" ; "D" ])
+ VerifySeqsEqual (iseq["D";"C";"B";"A"]) resultStr
+
+ // empty ISeq
+ VerifySeqsEqual ISeq.empty (ISeq.rev ISeq.empty)
+
+ //// null ISeq
+ //let nullSeq : iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.rev nullSeq |> ignore)
+ ()
+
+ []
+ member this.Scan() =
+ // integer ISeq
+ let funcInt x y = x+y
+ let resultInt = ISeq.scan funcInt 9 (iseq {1..10})
+ let expectedInt = iseq [9;10;12;15;19;24;30;37;45;54;64]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr x y = x+y
+ let resultStr =ISeq.scan funcStr "x" (iseq ["str1"; "str2";"str3" ])
+
+ let expectedStr = iseq ["x";"xstr1"; "xstr1str2";"xstr1str2str3"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.scan funcInt 5 ISeq.empty
+
+ VerifySeqsEqual resultEpt (iseq [ 5])
+
+ //// null ISeq
+ //let seqNull:iseq<'a> = null
+ //CheckThrowsArgumentNullException(fun() -> ISeq.scan funcInt 5 seqNull |> ignore)
+ ()
+
+ []
+ member this.ScanBack() =
+ // integer ISeq
+ let funcInt x y = x+y
+ let resultInt = ISeq.scanBack funcInt (iseq { 1..10 }) 9
+ let expectedInt = iseq [64;63;61;58;54;49;43;36;28;19;9]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr x y = x+y
+ let resultStr = ISeq.scanBack funcStr (iseq ["A";"B";"C";"D"]) "X"
+ let expectedStr = iseq ["ABCDX";"BCDX";"CDX";"DX";"X"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.scanBack funcInt ISeq.empty 5
+ let expectedEpt = iseq [5]
+ VerifySeqsEqual expectedEpt resultEpt
+
+ //// null ISeq
+ //let seqNull:iseq<'a> = null
+ //CheckThrowsArgumentNullException(fun() -> ISeq.scanBack funcInt seqNull 5 |> ignore)
+
+ // exception cases
+ let funcEx x (s:'State) = raise <| new System.FormatException() : 'State
+ // calling scanBack with funcEx does not throw
+ let resultEx = ISeq.scanBack funcEx (iseq <| seq {1..10}) 0
+ // reading from resultEx throws
+ CheckThrowsFormatException(fun() -> ISeq.head resultEx |> ignore)
+
+ // Result consumes entire input sequence as soon as it is accesses an element
+ let i = ref 0
+ let funcState x s = (i := !i + x); x+s
+ let resultState = ISeq.scanBack funcState (iseq <| seq {1..3}) 0
+ Assert.AreEqual(0, !i)
+ use e = resultState.GetEnumerator()
+ Assert.AreEqual(6, !i)
+
+ ()
+
+ []
+ member this.Singleton() =
+ // integer ISeq
+ let resultInt = ISeq.singleton 1
+
+ let expectedInt = iseq [1]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.singleton "str1"
+ let expectedStr = iseq ["str1"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // null ISeq
+ let resultNull = ISeq.singleton null
+ let expectedNull = iseq [null]
+ VerifySeqsEqual expectedNull resultNull
+ ()
+
+
+ []
+ member this.Skip() =
+
+ // integer ISeq
+ let resultInt = ISeq.skip 2 (iseq [1;2;3;4])
+ let expectedInt = iseq [3;4]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.skip 2 (iseq ["str1";"str2";"str3";"str4"])
+ let expectedStr = iseq ["str3";"str4"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.skip 0 ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.skip 1 null |> ignore)
+ ()
+
+ []
+ member this.Skip_While() =
+
+ // integer ISeq
+ let funcInt x = (x < 3)
+ let resultInt = ISeq.skipWhile funcInt (iseq [1;2;3;4;5;6])
+ let expectedInt = iseq [3;4;5;6]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr (x:string) = x.Contains(".")
+ let resultStr =ISeq.skipWhile funcStr (iseq [".";"asdfasdf.asdfasdf";"";"";"";"";"";"";"";"";""])
+ let expectedStr = iseq ["";"";"";"";"";"";"";"";""]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.skipWhile funcInt ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.skipWhile funcInt null |> ignore)
+ ()
+
+ []
+ member this.Sort() =
+
+ // integer ISeq
+ let resultInt = ISeq.sort (iseq [1;3;2;4;6;5;7])
+ let expectedInt = {1..7}
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+
+ let resultStr =ISeq.sort (iseq ["str1";"str3";"str2";"str4"])
+ let expectedStr = iseq ["str1";"str2";"str3";"str4"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.sort ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.sort null |> ignore)
+ ()
+
+ []
+ member this.SortBy() =
+
+ // integer ISeq
+ let funcInt x = Math.Abs(x-5)
+ let resultInt = ISeq.sortBy funcInt (iseq [1;2;4;5;7])
+ let expectedInt = iseq [5;4;7;2;1]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr (x:string) = x.IndexOf("key")
+ let resultStr =ISeq.sortBy funcStr (iseq ["st(key)r";"str(key)";"s(key)tr";"(key)str"])
+
+ let expectedStr = iseq ["(key)str";"s(key)tr";"st(key)r";"str(key)"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.sortBy funcInt ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.sortBy funcInt null |> ignore)
+ ()
+
+ []
+ member this.SortDescending() =
+
+ // integer ISeq
+ let resultInt = ISeq.sortDescending (iseq [1;3;2;Int32.MaxValue;4;6;Int32.MinValue;5;7;0])
+ let expectedInt = iseq <| seq {
+ yield Int32.MaxValue;
+ yield! iseq{ 7..-1..0 }
+ yield Int32.MinValue
+ }
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+
+ let resultStr = ISeq.sortDescending (iseq ["str1";null;"str3";"";"Str1";"str2";"str4"])
+ let expectedStr = iseq ["str4";"str3";"str2";"str1";"Str1";"";null]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.sortDescending ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ // tuple ISeq
+ let tupSeq = (iseq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")])
+ let resultTup = ISeq.sortDescending tupSeq
+ let expectedTup = (iseq[(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")])
+ VerifySeqsEqual expectedTup resultTup
+
+ // float ISeq
+ let minFloat,maxFloat,epsilon = System.Double.MinValue,System.Double.MaxValue,System.Double.Epsilon
+ let floatSeq = iseq [0.0; 0.5; 2.0; 1.5; 1.0; minFloat;maxFloat;epsilon;-epsilon]
+ let resultFloat = ISeq.sortDescending floatSeq
+ let expectedFloat = iseq [maxFloat; 2.0; 1.5; 1.0; 0.5; epsilon; 0.0; -epsilon; minFloat; ]
+ VerifySeqsEqual expectedFloat resultFloat
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.sort null |> ignore)
+ ()
+
+ []
+ member this.SortByDescending() =
+
+ // integer ISeq
+ let funcInt x = Math.Abs(x-5)
+ let resultInt = ISeq.sortByDescending funcInt (iseq [1;2;4;5;7])
+ let expectedInt = iseq [1;2;7;4;5]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr (x:string) = x.IndexOf("key")
+ let resultStr =ISeq.sortByDescending funcStr (iseq ["st(key)r";"str(key)";"s(key)tr";"(key)str"])
+
+ let expectedStr = iseq ["str(key)";"st(key)r";"s(key)tr";"(key)str"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.sortByDescending funcInt ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ // tuple ISeq
+ let tupSeq = (iseq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")])
+ let resultTup = ISeq.sortByDescending snd tupSeq
+ let expectedTup = (iseq[(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")])
+ VerifySeqsEqual expectedTup resultTup
+
+ // float ISeq
+ let minFloat,maxFloat,epsilon = System.Double.MinValue,System.Double.MaxValue,System.Double.Epsilon
+ let floatSeq = iseq [0.0; 0.5; 2.0; 1.5; 1.0; minFloat;maxFloat;epsilon;-epsilon]
+ let resultFloat = ISeq.sortByDescending id floatSeq
+ let expectedFloat = iseq [maxFloat; 2.0; 1.5; 1.0; 0.5; epsilon; 0.0; -epsilon; minFloat; ]
+ VerifySeqsEqual expectedFloat resultFloat
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.sortByDescending funcInt null |> ignore)
+ ()
+
+ member this.SortWith() =
+
+ // integer ISeq
+ let intComparer a b = compare (a%3) (b%3)
+ let resultInt = ISeq.sortWith intComparer (iseq <| seq {0..10})
+ let expectedInt = iseq [0;3;6;9;1;4;7;10;2;5;8]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr = ISeq.sortWith compare (iseq ["str1";"str3";"str2";"str4"])
+ let expectedStr = iseq ["str1";"str2";"str3";"str4"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.sortWith intComparer ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.sortWith intComparer null |> ignore)
+
+ ()
+
+ []
+ member this.Sum() =
+
+ // integer ISeq
+ let resultInt = ISeq.sum (iseq [1..10])
+ Assert.AreEqual(55,resultInt)
+
+ // float32 ISeq
+ let floatSeq = (iseq [ 1.2f;3.5f;6.7f ])
+ let resultFloat = ISeq.sum floatSeq
+ if resultFloat <> 11.4f then Assert.Fail()
+
+ // double ISeq
+ let doubleSeq = (iseq [ 1.0;8.0 ])
+ let resultDouble = ISeq.sum doubleSeq
+ if resultDouble <> 9.0 then Assert.Fail()
+
+ // decimal ISeq
+ let decimalSeq = (iseq [ 0M;19M;19.03M ])
+ let resultDecimal = ISeq.sum decimalSeq
+ if resultDecimal <> 38.03M then Assert.Fail()
+
+
+ // empty float32 ISeq
+ let emptyFloatSeq = ISeq.empty
+ let resultEptFloat = ISeq.sum emptyFloatSeq
+ if resultEptFloat <> 0.0f then Assert.Fail()
+
+ // empty double ISeq
+ let emptyDoubleSeq = ISeq.empty
+ let resultDouEmp = ISeq.sum emptyDoubleSeq
+ if resultDouEmp <> 0.0 then Assert.Fail()
+
+ // empty decimal ISeq
+ let emptyDecimalSeq = ISeq.empty
+ let resultDecEmp = ISeq.sum emptyDecimalSeq
+ if resultDecEmp <> 0M then Assert.Fail()
+
+ ()
+
+ []
+ member this.SumBy() =
+
+ // integer ISeq
+ let resultInt = ISeq.sumBy int (iseq [1..10])
+ Assert.AreEqual(55,resultInt)
+
+ // float32 ISeq
+ let floatSeq = (iseq [ 1.2f;3.5f;6.7f ])
+ let resultFloat = ISeq.sumBy float32 floatSeq
+ if resultFloat <> 11.4f then Assert.Fail()
+
+ // double ISeq
+ let doubleSeq = (iseq [ 1.0;8.0 ])
+ let resultDouble = ISeq.sumBy double doubleSeq
+ if resultDouble <> 9.0 then Assert.Fail()
+
+ // decimal ISeq
+ let decimalSeq = (iseq [ 0M;19M;19.03M ])
+ let resultDecimal = ISeq.sumBy decimal decimalSeq
+ if resultDecimal <> 38.03M then Assert.Fail()
+
+ // empty float32 ISeq
+ let emptyFloatSeq = ISeq.empty
+ let resultEptFloat = ISeq.sumBy float32 emptyFloatSeq
+ if resultEptFloat <> 0.0f then Assert.Fail()
+
+ // empty double ISeq
+ let emptyDoubleSeq = ISeq.empty
+ let resultDouEmp = ISeq.sumBy double emptyDoubleSeq
+ if resultDouEmp <> 0.0 then Assert.Fail()
+
+ // empty decimal ISeq
+ let emptyDecimalSeq = ISeq.empty
+ let resultDecEmp = ISeq.sumBy decimal emptyDecimalSeq
+ if resultDecEmp <> 0M then Assert.Fail()
+
+ ()
+
+ []
+ member this.Take() =
+ // integer ISeq
+
+ let resultInt = ISeq.take 3 (iseq [1;2;4;5;7])
+
+ let expectedInt = iseq [1;2;4]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+
+ let resultStr =ISeq.take 2(iseq ["str1";"str2";"str3";"str4"])
+
+ let expectedStr = iseq ["str1";"str2"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.take 0 ISeq.empty
+
+ VerifySeqsEqual resultEpt ISeq.empty
+
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.take 1 null |> ignore)
+ ()
+
+ []
+ member this.takeWhile() =
+ // integer ISeq
+ let funcInt x = (x < 6)
+ let resultInt = ISeq.takeWhile funcInt (iseq [1;2;4;5;6;7])
+
+ let expectedInt = iseq [1;2;4;5]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let funcStr (x:string) = (x.Length < 4)
+ let resultStr =ISeq.takeWhile funcStr (iseq ["a"; "ab"; "abc"; "abcd"; "abcde"])
+
+ let expectedStr = iseq ["a"; "ab"; "abc"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.takeWhile funcInt ISeq.empty
+ VerifySeqsEqual resultEpt ISeq.empty
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.takeWhile funcInt null |> ignore)
+ ()
+
+ []
+ member this.ToArray() =
+ // integer ISeq
+ let resultInt = ISeq.toArray(iseq [1;2;4;5;7])
+
+ let expectedInt = [|1;2;4;5;7|]
+ Assert.AreEqual(expectedInt,resultInt)
+
+ // string ISeq
+ let resultStr =ISeq.toArray (iseq ["str1";"str2";"str3"])
+
+ let expectedStr = [|"str1";"str2";"str3"|]
+ Assert.AreEqual(expectedStr,resultStr)
+
+ // empty ISeq
+ let resultEpt = ISeq.toArray ISeq.empty
+ Assert.AreEqual([||],resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.toArray null |> ignore)
+ ()
+
+ []
+ member this.ToArrayFromICollection() =
+ let inputCollection = ResizeArray(iseq [1;2;4;5;7])
+ let resultInt = ISeq.toArray((iseq inputCollection))
+ let expectedInt = [|1;2;4;5;7|]
+ Assert.AreEqual(expectedInt,resultInt)
+
+ []
+ member this.ToArrayEmptyInput() =
+ let resultInt = ISeq.toArray(ISeq.empty)
+ let expectedInt = Array.empty
+ Assert.AreEqual(expectedInt,resultInt)
+
+ []
+ member this.ToArrayFromArray() =
+ let resultInt = ISeq.toArray((iseq [|1;2;4;5;7|]))
+ let expectedInt = [|1;2;4;5;7|]
+ Assert.AreEqual(expectedInt,resultInt)
+
+ []
+ member this.ToArrayFromList() =
+ let resultInt = ISeq.toArray((iseq [1;2;4;5;7]))
+ let expectedInt = [|1;2;4;5;7|]
+ Assert.AreEqual(expectedInt,resultInt)
+
+ []
+ member this.ToList() =
+ // integer ISeq
+ let resultInt = ISeq.toList (iseq [1;2;4;5;7])
+ let expectedInt = [1;2;4;5;7]
+ Assert.AreEqual(expectedInt,resultInt)
+
+ // string ISeq
+ let resultStr =ISeq.toList (iseq ["str1";"str2";"str3"])
+ let expectedStr = ["str1";"str2";"str3"]
+ Assert.AreEqual(expectedStr,resultStr)
+
+ // empty ISeq
+ let resultEpt = ISeq.toList ISeq.empty
+ Assert.AreEqual([],resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.toList null |> ignore)
+ ()
+
+ []
+ member this.Truncate() =
+ // integer ISeq
+ let resultInt = ISeq.truncate 3 (iseq [1;2;4;5;7])
+ let expectedInt = [1;2;4]
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.truncate 2 (iseq ["str1";"str2";"str3"])
+ let expectedStr = ["str1";"str2"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.truncate 0 ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.truncate 1 null |> ignore)
+
+ // negative count
+ VerifySeqsEqual ISeq.empty <| ISeq.truncate -1 (iseq [1;2;4;5;7])
+ VerifySeqsEqual ISeq.empty <| ISeq.truncate System.Int32.MinValue (iseq [1;2;4;5;7])
+
+ ()
+
+ []
+ member this.tryFind() =
+ // integer ISeq
+ let resultInt = ISeq.tryFind (fun x -> (x%2=0)) (iseq [1;2;4;5;7])
+ Assert.AreEqual(Some(2), resultInt)
+
+ // integer ISeq - None
+ let resultInt = ISeq.tryFind (fun x -> (x%2=0)) (iseq [1;3;5;7])
+ Assert.AreEqual(None, resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryFind (fun (x:string) -> x.Contains("2")) (iseq ["str1";"str2";"str3"])
+ Assert.AreEqual(Some("str2"),resultStr)
+
+ // string ISeq - None
+ let resultStr = ISeq.tryFind (fun (x:string) -> x.Contains("2")) (iseq ["str1";"str4";"str3"])
+ Assert.AreEqual(None,resultStr)
+
+
+ // empty ISeq
+ let resultEpt = ISeq.tryFind (fun x -> (x%2=0)) ISeq.empty
+ Assert.AreEqual(None,resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.tryFind (fun x -> (x%2=0)) null |> ignore)
+ ()
+
+ []
+ member this.TryFindBack() =
+ // integer ISeq
+ let resultInt = ISeq.tryFindBack (fun x -> (x%2=0)) (iseq [1;2;4;5;7])
+ Assert.AreEqual(Some 4, resultInt)
+
+ // integer ISeq - None
+ let resultInt = ISeq.tryFindBack (fun x -> (x%2=0)) (iseq [1;3;5;7])
+ Assert.AreEqual(None, resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryFindBack (fun (x:string) -> x.Contains("2")) (iseq ["str1";"str2";"str2x";"str3"])
+ Assert.AreEqual(Some "str2x", resultStr)
+
+ // string ISeq - None
+ let resultStr = ISeq.tryFindBack (fun (x:string) -> x.Contains("2")) (iseq ["str1";"str4";"str3"])
+ Assert.AreEqual(None, resultStr)
+
+ // empty ISeq
+ let resultEpt = ISeq.tryFindBack (fun x -> (x%2=0)) ISeq.empty
+ Assert.AreEqual(None, resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.tryFindBack (fun x -> (x%2=0)) null |> ignore)
+ ()
+
+ []
+ member this.TryFindIndex() =
+
+ // integer ISeq
+ let resultInt = ISeq.tryFindIndex (fun x -> (x % 5 = 0)) (iseq [8; 9; 10])
+ Assert.AreEqual(Some(2), resultInt)
+
+ // integer ISeq - None
+ let resultInt = ISeq.tryFindIndex (fun x -> (x % 5 = 0)) (iseq [9;3;11])
+ Assert.AreEqual(None, resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryFindIndex (fun (x:string) -> x.Contains("2")) (iseq ["str1"; "str2"; "str3"])
+ Assert.AreEqual(Some(1),resultStr)
+
+ // string ISeq - None
+ let resultStr = ISeq.tryFindIndex (fun (x:string) -> x.Contains("2")) (iseq ["str1"; "str4"; "str3"])
+ Assert.AreEqual(None,resultStr)
+
+
+ // empty ISeq
+ let resultEpt = ISeq.tryFindIndex (fun x -> (x%2=0)) ISeq.empty
+ Assert.AreEqual(None, resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.tryFindIndex (fun x -> (x % 2 = 0)) null |> ignore)
+ ()
+
+ []
+ member this.TryFindIndexBack() =
+
+ // integer ISeq
+ let resultInt = ISeq.tryFindIndexBack (fun x -> (x % 5 = 0)) (iseq [5; 9; 10; 12])
+ Assert.AreEqual(Some(2), resultInt)
+
+ // integer ISeq - None
+ let resultInt = ISeq.tryFindIndexBack (fun x -> (x % 5 = 0)) (iseq [9;3;11])
+ Assert.AreEqual(None, resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryFindIndexBack (fun (x:string) -> x.Contains("2")) (iseq ["str1"; "str2"; "str2x"; "str3"])
+ Assert.AreEqual(Some(2), resultStr)
+
+ // string ISeq - None
+ let resultStr = ISeq.tryFindIndexBack (fun (x:string) -> x.Contains("2")) (iseq ["str1"; "str4"; "str3"])
+ Assert.AreEqual(None, resultStr)
+
+ // empty ISeq
+ let resultEpt = ISeq.tryFindIndexBack (fun x -> (x%2=0)) ISeq.empty
+ Assert.AreEqual(None, resultEpt)
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.tryFindIndexBack (fun x -> (x % 2 = 0)) null |> ignore)
+ ()
+
+ []
+ member this.Unfold() =
+ // integer ISeq
+
+ let resultInt = ISeq.unfold (fun x -> if x = 1 then Some(7,2) else None) 1
+
+ VerifySeqsEqual (iseq [7]) resultInt
+
+ // string ISeq
+ let resultStr =ISeq.unfold (fun (x:string) -> if x.Contains("unfold") then Some("a","b") else None) "unfold"
+ VerifySeqsEqual (iseq ["a"]) resultStr
+ ()
+
+
+ []
+ member this.Windowed() =
+
+ let testWindowed config =
+ try
+ config.InputSeq
+ |> ISeq.windowed config.WindowSize
+ |> VerifySeqsEqual config.ExpectedSeq
+ with
+ | _ when Option.isNone config.Exception -> Assert.Fail()
+ | e when e.GetType() = (Option.get config.Exception) -> ()
+ | _ -> Assert.Fail()
+
+ {
+ InputSeq = iseq [1..10]
+ WindowSize = 1
+ ExpectedSeq = iseq <| seq { for i in 1..10 do yield [| i |] }
+ Exception = None
+ } |> testWindowed
+ {
+ InputSeq = iseq [1..10]
+ WindowSize = 5
+ ExpectedSeq = iseq <| seq { for i in 1..6 do yield [| i; i+1; i+2; i+3; i+4 |] }
+ Exception = None
+ } |> testWindowed
+ {
+ InputSeq = iseq [1..10]
+ WindowSize = 10
+ ExpectedSeq = iseq <| seq { yield [| 1 .. 10 |] }
+ Exception = None
+ } |> testWindowed
+ {
+ InputSeq = iseq [1..10]
+ WindowSize = 25
+ ExpectedSeq = ISeq.empty
+ Exception = None
+ } |> testWindowed
+ {
+ InputSeq = iseq ["str1";"str2";"str3";"str4"]
+ WindowSize = 2
+ ExpectedSeq = iseq [ [|"str1";"str2"|];[|"str2";"str3"|];[|"str3";"str4"|]]
+ Exception = None
+ } |> testWindowed
+ {
+ InputSeq = ISeq.empty
+ WindowSize = 2
+ ExpectedSeq = ISeq.empty
+ Exception = None
+ } |> testWindowed
+ //{
+ // InputSeq = null
+ // WindowSize = 2
+ // ExpectedSeq = ISeq.empty
+ // Exception = Some typeof
+ //} |> testWindowed
+ {
+ InputSeq = iseq [1..10]
+ WindowSize = 0
+ ExpectedSeq = ISeq.empty
+ Exception = Some typeof
+ } |> testWindowed
+
+ ()
+
+ []
+ member this.Zip() =
+
+ // integer ISeq
+ let resultInt = ISeq.zip (iseq [1..7]) (iseq [11..17])
+ let expectedInt =
+ iseq <| seq { for i in 1..7 do
+ yield i, i+10 }
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.zip (iseq ["str3";"str4"]) (iseq ["str1";"str2"])
+ let expectedStr = iseq ["str3","str1";"str4","str2"]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.zip ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip null null |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip null (iseq [1..7]) |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip (iseq [1..7]) null |> ignore)
+ ()
+
+ []
+ member this.Zip3() =
+ // integer ISeq
+ let resultInt = ISeq.zip3 (iseq [1..7]) (iseq [11..17]) (iseq [21..27])
+ let expectedInt =
+ iseq <| seq { for i in 1..7 do
+ yield i, (i + 10), (i + 20) }
+ VerifySeqsEqual expectedInt resultInt
+
+ // string ISeq
+ let resultStr =ISeq.zip3 (iseq ["str1";"str2"]) (iseq ["str11";"str12"]) (iseq ["str21";"str22"])
+ let expectedStr = iseq ["str1","str11","str21";"str2","str12","str22" ]
+ VerifySeqsEqual expectedStr resultStr
+
+ // empty ISeq
+ let resultEpt = ISeq.zip3 ISeq.empty ISeq.empty ISeq.empty
+ VerifySeqsEqual ISeq.empty resultEpt
+
+ //// null ISeq
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip3 null null null |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip3 null (iseq [1..7]) (iseq [1..7]) |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip3 (iseq [1..7]) null (iseq [1..7]) |> ignore)
+ //CheckThrowsArgumentNullException(fun() -> ISeq.zip3 (iseq [1..7]) (iseq [1..7]) null |> ignore)
+ ()
+
+ []
+ member this.tryPick() =
+ // integer ISeq
+ let resultInt = ISeq.tryPick (fun x-> if x = 1 then Some("got") else None) (iseq [1..5])
+
+ Assert.AreEqual(Some("got"),resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryPick (fun x-> if x = "Are" then Some("got") else None) (iseq ["Lists"; "Are"])
+ Assert.AreEqual(Some("got"),resultStr)
+
+ // empty ISeq
+ let resultEpt = ISeq.tryPick (fun x-> if x = 1 then Some("got") else None) ISeq.empty
+ Assert.IsNull(resultEpt)
+
+ //// null ISeq
+ //let nullSeq : iseq<'a> = null
+ //let funcNull x = Some(1)
+
+ //CheckThrowsArgumentNullException(fun () -> ISeq.tryPick funcNull nullSeq |> ignore)
+
+ ()
+
+ []
+ member this.tryItem() =
+ // integer ISeq
+ let resultInt = ISeq.tryItem 3 (iseq { 10..20 })
+ Assert.AreEqual(Some(13), resultInt)
+
+ // string ISeq
+ let resultStr = ISeq.tryItem 2 (iseq ["Lists"; "Are"; "Cool"; "List" ])
+ Assert.AreEqual(Some("Cool"), resultStr)
+
+ // empty ISeq
+ let resultEmpty = ISeq.tryItem 0 ISeq.empty
+ Assert.AreEqual(None, resultEmpty)
+
+ //// null ISeq
+ //let nullSeq:iseq<'a> = null
+ //CheckThrowsArgumentNullException (fun () -> ISeq.tryItem 3 nullSeq |> ignore)
+
+ // Negative index
+ let resultNegativeIndex = ISeq.tryItem -1 (iseq { 10..20 })
+ Assert.AreEqual(None, resultNegativeIndex)
+
+ // Index greater than length
+ let resultIndexGreater = ISeq.tryItem 31 (iseq { 10..20 })
+ Assert.AreEqual(None, resultIndexGreater)
diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqProperties.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqProperties.fs
new file mode 100644
index 00000000000..d37172bf0b9
--- /dev/null
+++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ISeqProperties.fs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+module FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Collections.ISeqProperties
+
+open System
+open System.Collections.Generic
+open NUnit.Framework
+open FsCheck
+open Utils
+
+let sortByStable<'a when 'a : comparison> (xs : 'a []) =
+ let indexed = xs|> ISeq.ofSeq |> ISeq.indexed
+ let sorted = indexed |> ISeq.sortBy snd
+ isStable sorted
+
+[]
+let ``ISeq.sortBy is stable`` () =
+ Check.QuickThrowOnFailure sortByStable
+ Check.QuickThrowOnFailure sortByStable
+
+let sortWithStable<'a when 'a : comparison> (xs : 'a []) =
+ let indexed = xs |> ISeq.ofSeq |> ISeq.indexed |> Seq.toList
+ let sorted = indexed |> ISeq.ofSeq |> ISeq.sortWith (fun x y -> compare (snd x) (snd y))
+ isStable sorted
+
+[]
+let ``ISeq.sortWithStable is stable`` () =
+ Check.QuickThrowOnFailure sortWithStable
+ Check.QuickThrowOnFailure sortWithStable
+
+let distinctByStable<'a when 'a : comparison> (xs : 'a []) =
+ let indexed = xs|> ISeq.ofSeq |> ISeq.indexed
+ let sorted = indexed |> ISeq.distinctBy snd
+ isStable sorted
+
+[]
+let ``ISeq.distinctBy is stable`` () =
+ Check.QuickThrowOnFailure distinctByStable
+ Check.QuickThrowOnFailure distinctByStable
diff --git a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs
index cd7c9087a50..a6dca4658b8 100644
--- a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs
+++ b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs
@@ -293,6 +293,193 @@ Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityC
Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] Structural[T]()
Microsoft.FSharp.Collections.HashIdentity: System.String ToString()
Microsoft.FSharp.Collections.HashIdentity: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TResult Result
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TResult get_Result()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void .ctor(TResult, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void OnComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void OnDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TResult Result
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TResult get_Result()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void .ctor(TResult, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void .ctor(Microsoft.FSharp.Collections.SeqComposition.Activity, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void OnComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void OnDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void .ctor(Microsoft.FSharp.Collections.SeqComposition.Activity, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Void .ctor(a)
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Void .ctor(a, b)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: b _2
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Void .ctor(a, b, c)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: b _2
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: c _3
+Microsoft.FSharp.Collections.ISeqModule+Core: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]
+Microsoft.FSharp.Collections.ISeqModule+Core: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule: Boolean Exists2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean ForAll2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean IsEmpty[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 CompareWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 FindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 FindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule: Int32 Length[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.ISeqModule+Core
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[System.Int32,a]] Indexed[a](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T,T]] Pairwise[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T1,T2]] Zip[T1,T2](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]]] GroupByRef[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]]] GroupByVal[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,System.Int32]] CountByRef[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,System.Int32]] CountByVal[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`3[T1,T2,T3]] Zip3[T1,T2,T3](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T3])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] Collect[T,TCollection,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TCollection], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TState] Scan[TState,T](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] ChunkBySize[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] SplitInto[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] Windowed[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Append[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Cache[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Cast[T](System.Collections.IEnumerable)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Concat[TCollection,T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TCollection])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Delay[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Distinct[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Empty[T]()
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Except[T](System.Collections.Generic.IEnumerable`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] InitializeInfinite[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfArray[T](T[])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfList[T](Microsoft.FSharp.Collections.FSharpList`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfResizeArrayUnchecked[T](System.Collections.Generic.List`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfSeq[T](System.Collections.Generic.IEnumerable`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Permute[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Replicate[T](Int32, T)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Reverse[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Singleton[T](T)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Skip[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortDescending[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Sort[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Tail[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Take[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Truncate[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Unfold[TState,T](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V] Map2[T,TResult,V](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,V]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V] MapIndexed2[T,TResult,V](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,V]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[W] Map3[T,TResult,V,W](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,W]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[b] Choose[a,b](Microsoft.FSharp.Core.FSharpFunc`2[a,Microsoft.FSharp.Core.FSharpOption`1[b]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[b] MapIndexed[a,b](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[a,b]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule: System.Tuple`2[Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult],TState] MapFoldBack[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,System.Tuple`2[TResult,TState]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: System.Tuple`2[Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult],TState] MapFold[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Tuple`2[TResult,TState]]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule: T Average[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T ExactlyOne[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Head[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Item[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Last[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T MaxBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Max[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T MinBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Min[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T ReduceBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Reduce[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Sum[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult AverageBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult Pick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult SumBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TState Fold2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TState]]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: TState FoldBack2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2], TState)
+Microsoft.FSharp.Collections.ISeqModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T[] ToArray[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Void Iterate2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Void IterateIndexed2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.Unit]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
Microsoft.FSharp.Collections.ListModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.FSharpList`1[T])
Microsoft.FSharp.Collections.ListModule: Boolean Equals(System.Object)
Microsoft.FSharp.Collections.ListModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2])
@@ -425,6 +612,55 @@ Microsoft.FSharp.Collections.MapModule: TResult Pick[TKey,T,TResult](Microsoft.F
Microsoft.FSharp.Collections.MapModule: TState FoldBack[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T], TState)
Microsoft.FSharp.Collections.MapModule: TState Fold[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]]], TState, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T])
Microsoft.FSharp.Collections.MapModule: Void Iterate[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T])
+Microsoft.FSharp.Collections.SeqComposition.Activity: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void .ctor()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void .ctor()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Core: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Core: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Core: Microsoft.FSharp.Collections.SeqComposition.Core+NoValue
+Microsoft.FSharp.Collections.SeqComposition.Core: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Core: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: TResult Result
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: TResult get_Result()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void .ctor(TResult)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.SeqComposition.IOutOfBand: Void ListenForStopFurtherProcessing(System.Action`1[System.Int32])
+Microsoft.FSharp.Collections.SeqComposition.IOutOfBand: Void StopFurtherProcessing(Int32)
+Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] PushTransform[TResult](Microsoft.FSharp.Collections.SeqComposition.ITransformFactory`2[T,TResult])
+Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]: TResult Fold[TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]])
+Microsoft.FSharp.Collections.SeqComposition.ITransformFactory`2[T,TResult]: Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,V] Compose[V](Microsoft.FSharp.Collections.SeqComposition.IOutOfBand, Int32, Microsoft.FSharp.Collections.SeqComposition.Activity`2[TResult,V])
Microsoft.FSharp.Collections.SeqModule: Boolean Contains[T](T, System.Collections.Generic.IEnumerable`1[T])
Microsoft.FSharp.Collections.SeqModule: Boolean Equals(System.Object)
Microsoft.FSharp.Collections.SeqModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2])
@@ -882,7 +1118,10 @@ Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean Equal
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean get_CheckClose()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 GenerateNext(System.Collections.Generic.IEnumerable`1[T] ByRef)
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 GetHashCode()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 Length()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Append(Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Collections.Generic.IEnumerator`1[T] GetFreshEnumerator()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Collections.Generic.IEnumerable`1[T] GetRaw()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.String ToString()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Type GetType()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: T LastGenerated
diff --git a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs
index 0fdcc27abea..b1f492245e1 100644
--- a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs
+++ b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs
@@ -280,6 +280,193 @@ Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityC
Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] Structural[T]()
Microsoft.FSharp.Collections.HashIdentity: System.String ToString()
Microsoft.FSharp.Collections.HashIdentity: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TResult Result
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TResult get_Result()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void .ctor(TResult, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void OnComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void OnDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TResult Result
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TResult get_Result()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void .ctor(TResult, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void .ctor(Microsoft.FSharp.Collections.SeqComposition.Activity, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void OnComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]: Void OnDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: TState State
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void .ctor(Microsoft.FSharp.Collections.SeqComposition.Activity, TState)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]: Void ChainDispose()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: Void .ctor(a)
+Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: Void .ctor(a, b)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]: b _2
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: Void .ctor(a, b, c)
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: a _1
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: b _2
+Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]: c _3
+Microsoft.FSharp.Collections.ISeqModule+Core: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule+Core: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithPostProcessing`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+FolderWithState`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+TransformWithPostProcessing`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Transform`3[T,TResult,TState]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Value`1[a]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Values`2[a,b]
+Microsoft.FSharp.Collections.ISeqModule+Core: Microsoft.FSharp.Collections.ISeqModule+Core+Values`3[a,b,c]
+Microsoft.FSharp.Collections.ISeqModule+Core: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule+Core: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.ISeqModule: Boolean Exists2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean ForAll2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Boolean IsEmpty[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 CompareWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 FindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 FindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Int32 GetHashCode()
+Microsoft.FSharp.Collections.ISeqModule: Int32 Length[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.ISeqModule+Core
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[System.Int32,a]] Indexed[a](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T,T]] Pairwise[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[T1,T2]] Zip[T1,T2](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]]] GroupByRef[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]]] GroupByVal[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,System.Int32]] CountByRef[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`2[TKey,System.Int32]] CountByVal[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[System.Tuple`3[T1,T2,T3]] Zip3[T1,T2,T3](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T3])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] Collect[T,TCollection,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TCollection], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TState] Scan[TState,T](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] ChunkBySize[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] SplitInto[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T[]] Windowed[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Append[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Cache[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Cast[T](System.Collections.IEnumerable)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Concat[TCollection,T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TCollection])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Delay[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Distinct[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Empty[T]()
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Except[T](System.Collections.Generic.IEnumerable`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] InitializeInfinite[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfArray[T](T[])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfList[T](Microsoft.FSharp.Collections.FSharpList`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfResizeArrayUnchecked[T](System.Collections.Generic.List`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] OfSeq[T](System.Collections.Generic.IEnumerable`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Permute[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Replicate[T](Int32, T)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Reverse[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Singleton[T](T)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Skip[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortDescending[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Sort[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Tail[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Take[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Truncate[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Unfold[TState,T](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState)
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V] Map2[T,TResult,V](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,V]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V] MapIndexed2[T,TResult,V](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,V]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[W] Map3[T,TResult,V,W](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,W]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[V])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[b] Choose[a,b](Microsoft.FSharp.Core.FSharpFunc`2[a,Microsoft.FSharp.Core.FSharpOption`1[b]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[b] MapIndexed[a,b](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[a,b]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[a])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: System.String ToString()
+Microsoft.FSharp.Collections.ISeqModule: System.Tuple`2[Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult],TState] MapFoldBack[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,System.Tuple`2[TResult,TState]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: System.Tuple`2[Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult],TState] MapFold[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Tuple`2[TResult,TState]]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: System.Type GetType()
+Microsoft.FSharp.Collections.ISeqModule: T Average[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T ExactlyOne[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Head[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Item[T](Int32, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Last[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T MaxBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Max[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T MinBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Min[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T ReduceBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Reduce[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T Sum[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult AverageBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult Pick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TResult SumBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: TState Fold2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TState]]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2])
+Microsoft.FSharp.Collections.ISeqModule: TState FoldBack2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T1], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T2], TState)
+Microsoft.FSharp.Collections.ISeqModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], TState)
+Microsoft.FSharp.Collections.ISeqModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: T[] ToArray[T](Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Void Iterate2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Void IterateIndexed2[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.Unit]]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult])
+Microsoft.FSharp.Collections.ISeqModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
+Microsoft.FSharp.Collections.ISeqModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
Microsoft.FSharp.Collections.ListModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.FSharpList`1[T])
Microsoft.FSharp.Collections.ListModule: Boolean Equals(System.Object)
Microsoft.FSharp.Collections.ListModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2])
@@ -412,6 +599,55 @@ Microsoft.FSharp.Collections.MapModule: TResult Pick[TKey,T,TResult](Microsoft.F
Microsoft.FSharp.Collections.MapModule: TState FoldBack[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T], TState)
Microsoft.FSharp.Collections.MapModule: TState Fold[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]]], TState, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T])
Microsoft.FSharp.Collections.MapModule: Void Iterate[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T])
+Microsoft.FSharp.Collections.SeqComposition.Activity: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void .ctor()
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity`1[T]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void .ctor()
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,TResult]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Core+NoValue: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Core: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Core: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Core: Microsoft.FSharp.Collections.SeqComposition.Core+NoValue
+Microsoft.FSharp.Collections.SeqComposition.Core: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Core: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Boolean Equals(System.Object)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Boolean ProcessNext(T)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 GetHashCode()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 HaltedIdx
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Int32 get_HaltedIdx()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: System.String ToString()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: System.Type GetType()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: TResult Result
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: TResult get_Result()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void .ctor(TResult)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void ChainComplete(Int32)
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void ChainDispose()
+Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]: Void set_Result(TResult)
+Microsoft.FSharp.Collections.SeqComposition.IOutOfBand: Void ListenForStopFurtherProcessing(System.Action`1[System.Int32])
+Microsoft.FSharp.Collections.SeqComposition.IOutOfBand: Void StopFurtherProcessing(Int32)
+Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[TResult] PushTransform[TResult](Microsoft.FSharp.Collections.SeqComposition.ITransformFactory`2[T,TResult])
+Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T]: TResult Fold[TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Collections.SeqComposition.Folder`2[T,TResult]])
+Microsoft.FSharp.Collections.SeqComposition.ITransformFactory`2[T,TResult]: Microsoft.FSharp.Collections.SeqComposition.Activity`2[T,V] Compose[V](Microsoft.FSharp.Collections.SeqComposition.IOutOfBand, Int32, Microsoft.FSharp.Collections.SeqComposition.Activity`2[TResult,V])
Microsoft.FSharp.Collections.SeqModule: Boolean Contains[T](T, System.Collections.Generic.IEnumerable`1[T])
Microsoft.FSharp.Collections.SeqModule: Boolean Equals(System.Object)
Microsoft.FSharp.Collections.SeqModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2])
@@ -916,7 +1152,10 @@ Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean Equal
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean get_CheckClose()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 GenerateNext(System.Collections.Generic.IEnumerable`1[T] ByRef)
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 GetHashCode()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 Length()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T] Append(Microsoft.FSharp.Collections.SeqComposition.ISeq`1[T])
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Collections.Generic.IEnumerator`1[T] GetFreshEnumerator()
+Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Collections.Generic.IEnumerable`1[T] GetRaw()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.String ToString()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Type GetType()
Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: T LastGenerated
diff --git a/src/fsharp/FSharp.Core/FSharp.Core.fsproj b/src/fsharp/FSharp.Core/FSharp.Core.fsproj
index ee0bd8f50ef..7ca7782f4a4 100644
--- a/src/fsharp/FSharp.Core/FSharp.Core.fsproj
+++ b/src/fsharp/FSharp.Core/FSharp.Core.fsproj
@@ -94,12 +94,30 @@
Collections/collections.fs
+
+ Collections/list.fsi
+
+
+ Collections/list.fs
+
+
+ Collections/array.fsi
+
+
+ Collections/array.fs
+
Collections/seqcore.fsi
Collections/seqcore.fs
+
+ Collections/iseq.fsi
+
+
+ Collections/iseq.fs
+
Collections/seq.fsi
@@ -112,18 +130,6 @@
Collections/string.fs
-
- Collections/list.fsi
-
-
- Collections/list.fs
-
-
- Collections/array.fsi
-
-
- Collections/array.fs
-
Collections/array3.fsi
diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs
index 3a1cd0a94ef..c33e97b11cb 100644
--- a/src/fsharp/FSharp.Core/array.fs
+++ b/src/fsharp/FSharp.Core/array.fs
@@ -8,7 +8,6 @@ namespace Microsoft.FSharp.Collections
open Microsoft.FSharp.Core
open Microsoft.FSharp.Collections
open Microsoft.FSharp.Core.Operators
- open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
#if FX_RESHAPED_REFLECTION
open System.Reflection
@@ -100,12 +99,22 @@ namespace Microsoft.FSharp.Collections
j <- j + len
res
+ []
+ let toSeq array =
+ checkNonNull "array" array
+ Microsoft.FSharp.Primitives.Basics.Array.toSeq array
+
+ []
+ let ofSeq source =
+ checkNonNull "source" source
+ Microsoft.FSharp.Primitives.Basics.Array.ofSeq source
+
[]
let concat (arrays: seq<'T[]>) =
checkNonNull "arrays" arrays
match arrays with
| :? ('T[][]) as ts -> ts |> concatArrays // avoid a clone, since we only read the array
- | _ -> arrays |> Seq.toArray |> concatArrays
+ | _ -> arrays |> ofSeq |> concatArrays
[]
let replicate count x =
@@ -185,7 +194,7 @@ namespace Microsoft.FSharp.Collections
let countByValueType (projection:'T->'Key) (array:'T[]) = countByImpl HashIdentity.Structural<'Key> projection id array
// Wrap a StructBox around all keys in case the key type is itself a type using null as a representation
- let countByRefType (projection:'T->'Key) (array:'T[]) = countByImpl RuntimeHelpers.StructBox<'Key>.Comparer (fun t -> RuntimeHelpers.StructBox (projection t)) (fun sb -> sb.Value) array
+ let countByRefType (projection:'T->'Key) (array:'T[]) = countByImpl StructBox<'Key>.Comparer (fun t -> StructBox (projection t)) (fun sb -> sb.Value) array
[]
let countBy (projection:'T->'Key) (array:'T[]) =
@@ -435,7 +444,7 @@ namespace Microsoft.FSharp.Collections
let groupByValueType (keyf:'T->'Key) (array:'T[]) = groupByImpl HashIdentity.Structural<'Key> keyf id array
// Wrap a StructBox around all keys in case the key type is itself a type using null as a representation
- let groupByRefType (keyf:'T->'Key) (array:'T[]) = groupByImpl RuntimeHelpers.StructBox<'Key>.Comparer (fun t -> RuntimeHelpers.StructBox (keyf t)) (fun sb -> sb.Value) array
+ let groupByRefType (keyf:'T->'Key) (array:'T[]) = groupByImpl StructBox<'Key>.Comparer (fun t -> StructBox (keyf t)) (fun sb -> sb.Value) array
[]
let groupBy (keyf:'T->'Key) (array:'T[]) =
@@ -1054,16 +1063,6 @@ namespace Microsoft.FSharp.Collections
let inline compareDescending a b = compare b a
sortWith compareDescending array
- []
- let toSeq array =
- checkNonNull "array" array
- Seq.ofArray array
-
- []
- let ofSeq source =
- checkNonNull "source" source
- Seq.toArray source
-
[]
let findIndex f (array : _[]) =
checkNonNull "array" array
diff --git a/src/fsharp/FSharp.Core/collections.fs b/src/fsharp/FSharp.Core/collections.fs
index 49275a4f529..46c73a8f68c 100644
--- a/src/fsharp/FSharp.Core/collections.fs
+++ b/src/fsharp/FSharp.Core/collections.fs
@@ -48,3 +48,12 @@ namespace Microsoft.FSharp.Collections
{ new IComparer<'T> with
member __.Compare(x,y) = comparer.Invoke(x,y) }
+ []
+ type internal StructBox<'T when 'T:equality>(value:'T) =
+ member x.Value = value
+ static member Comparer =
+ let gcomparer = HashIdentity.Structural<'T>
+ { new IEqualityComparer> with
+ member __.GetHashCode(v) = gcomparer.GetHashCode(v.Value)
+ member __.Equals(v1,v2) = gcomparer.Equals(v1.Value,v2.Value) }
+
diff --git a/src/fsharp/FSharp.Core/collections.fsi b/src/fsharp/FSharp.Core/collections.fsi
index d81b542a319..5b04c9b32ba 100644
--- a/src/fsharp/FSharp.Core/collections.fsi
+++ b/src/fsharp/FSharp.Core/collections.fsi
@@ -49,4 +49,8 @@ namespace Microsoft.FSharp.Collections
// inline justification: allows inlining of hash functions
val inline FromFunctions<'T> : hasher:('T -> int) -> equality:('T -> 'T -> bool) -> IEqualityComparer<'T>
-
+ []
+ type internal StructBox<'T when 'T : equality> =
+ new : value:'T -> StructBox<'T>
+ member Value : 'T
+ static member Comparer : IEqualityComparer>
diff --git a/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs b/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs
index a2517c16cc3..6014d10105e 100644
--- a/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs
+++ b/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs
@@ -98,7 +98,7 @@ module ExtraTopLevelOperators =
let dictValueType (l:seq<'Key*'T>) = dictImpl HashIdentity.Structural<'Key> id id l
// Wrap a StructBox around all keys in case the key type is itself a type using null as a representation
- let dictRefType (l:seq<'Key*'T>) = dictImpl RuntimeHelpers.StructBox<'Key>.Comparer (fun k -> RuntimeHelpers.StructBox k) (fun sb -> sb.Value) l
+ let dictRefType (l:seq<'Key*'T>) = dictImpl StructBox<'Key>.Comparer (fun k -> StructBox k) (fun sb -> sb.Value) l
[]
let dict (l:seq<'Key*'T>) =
diff --git a/src/fsharp/FSharp.Core/iseq.fs b/src/fsharp/FSharp.Core/iseq.fs
new file mode 100644
index 00000000000..92dc11b2775
--- /dev/null
+++ b/src/fsharp/FSharp.Core/iseq.fs
@@ -0,0 +1,1345 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace Microsoft.FSharp.Collections
+ open System
+ open System.Diagnostics
+ open System.Collections
+ open System.Collections.Generic
+ open System.Reflection
+ open Microsoft.FSharp.Core
+ open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
+ open Microsoft.FSharp.Core.Operators
+ open Microsoft.FSharp.Core.CompilerServices
+ open Microsoft.FSharp.Control
+ open Microsoft.FSharp.Collections
+ open Microsoft.FSharp.Primitives.Basics
+ open Microsoft.FSharp.Collections.SeqComposition
+ open Microsoft.FSharp.Collections.SeqComposition.Core
+
+ []
+ module ISeq =
+ open IEnumerator
+
+ module Core =
+ []
+ type Value<'a> =
+ val mutable _1 : 'a
+ new (a:'a) = { _1 = a }
+
+ []
+ type Values<'a,'b> =
+ val mutable _1 : 'a
+ val mutable _2 : 'b
+ new (a:'a, b: 'b) = { _1 = a; _2 = b }
+
+ []
+ type Values<'a,'b,'c> =
+ val mutable _1 : 'a
+ val mutable _2 : 'b
+ val mutable _3 : 'c
+ new (a:'a, b:'b, c:'c) = { _1 = a; _2 = b; _3 = c }
+
+ []
+ type Transform<'T,'U,'State> =
+ inherit Activity<'T,'U>
+
+ new (next:Activity, initState:'State) = {
+ inherit Activity<'T,'U> ()
+ State = initState
+ Next = next
+ }
+
+ val mutable State : 'State
+ val Next : Activity
+
+ override this.ChainComplete terminatingIdx =
+ this.Next.ChainComplete terminatingIdx
+ override this.ChainDispose () =
+ this.Next.ChainDispose ()
+
+ []
+ type TransformWithPostProcessing<'T,'U,'State>(next:Activity, initState:'State) =
+ inherit Transform<'T,'U,'State>(next, initState)
+
+ abstract OnComplete : PipeIdx -> unit
+ abstract OnDispose : unit -> unit
+
+ override this.ChainComplete terminatingIdx =
+ this.OnComplete terminatingIdx
+ this.Next.ChainComplete terminatingIdx
+ override this.ChainDispose () =
+ try this.OnDispose ()
+ finally this.Next.ChainDispose ()
+
+ []
+ type FolderWithState<'T,'Result,'State> =
+ inherit Folder<'T,'Result>
+
+ val mutable State : 'State
+
+ new (initalResult,initState) = {
+ inherit Folder<'T,'Result>(initalResult)
+ State = initState
+ }
+
+ []
+ type FolderWithPostProcessing<'T,'Result,'State>(initResult,initState) =
+ inherit FolderWithState<'T,'Result,'State>(initResult,initState)
+
+ abstract OnComplete : PipeIdx -> unit
+ abstract OnDispose : unit -> unit
+
+ override this.ChainComplete terminatingIdx =
+ this.OnComplete terminatingIdx
+ override this.ChainDispose () =
+ this.OnDispose ()
+
+ open Core
+
+ module internal TailCall =
+ // used for performance reasons; these are not recursive calls, so should be safe
+ // ** it should be noted that potential changes to the f# compiler may render this function
+ // ineffictive **
+ let inline avoid boolean = match boolean with true -> true | false -> false
+
+ let inline valueComparer<'T when 'T : equality> ()=
+ let c = HashIdentity.Structural<'T>
+ { new IEqualityComparer> with
+ member __.GetHashCode o = c.GetHashCode o._1
+ member __.Equals (lhs,rhs) = c.Equals (lhs._1, rhs._1) }
+
+ []
+ type PreferGetEnumerator<'T>() =
+ inherit EnumerableBase<'T>()
+
+ abstract GetEnumerator: unit -> IEnumerator<'T>
+ abstract GetSeq : unit -> ISeq<'T>
+
+ interface IEnumerable<'T> with
+ member this.GetEnumerator () : IEnumerator<'T> = this.GetEnumerator ()
+
+ interface ISeq<'T> with
+ member this.PushTransform<'U> (next:ITransformFactory<'T,'U>) : ISeq<'U> = (this.GetSeq()).PushTransform next
+ member this.Fold<'Result> (f:PipeIdx->Folder<'T,'Result>) : 'Result = (this.GetSeq()).Fold f
+
+ []
+ let empty<'T> = Microsoft.FSharp.Collections.SeqComposition.Core.EmptyEnumerable<'T>.Instance
+
+ []
+ let singleton<'T> (x:'T) : ISeq<'T> = upcast (new SingletonEnumerable<_>(x))
+
+ /// wraps a ResizeArray in the ISeq framework. Care must be taken that the underlying ResizeArray
+ /// is not modified whilst it can be accessed as the ISeq, so check on version is performed.
+ /// i.e. usually iteration on calls the enumerator provied by GetEnumerator ensure that the
+ /// list hasn't been modified (throwing an exception if it has), but such a check is not
+ /// performed in this case. If you want this funcitonality, then use the ofSeq function instead.
+ []
+ let ofResizeArrayUnchecked (source:ResizeArray<'T>) : ISeq<'T> =
+ upcast (ThinResizeArrayEnumerable<'T> source)
+
+ []
+ let ofArray (source:array<'T>) : ISeq<'T> =
+ checkNonNull "source" source
+ upcast (ThinArrayEnumerable<'T> source)
+
+ []
+ let ofList (source:list<'T>) : ISeq<'T> =
+ upcast source
+
+ []
+ let ofSeq (source:seq<'T>) : ISeq<'T> =
+ match source with
+ | :? ISeq<'T> as seq -> seq
+ | :? array<'T> as array -> ofArray array
+ | null -> nullArg "source"
+ | _ -> upcast (ThinEnumerable<'T> source)
+
+ []
+ let inline average (source:ISeq<'T>) =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'T,int> (LanguagePrimitives.GenericZero, 0) with
+ override this.ProcessNext value =
+ this.Result <- Checked.(+) this.Result value
+ this.State <- this.State + 1
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State = 0 then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ this.Result <- LanguagePrimitives.DivideByInt<'T> this.Result this.State
+ override this.OnDispose () = () })
+
+ []
+ let inline averageBy (f:'T->'U) (source:ISeq<'T>) =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'U,int>(LanguagePrimitives.GenericZero,0) with
+ override this.ProcessNext value =
+ this.Result <- Checked.(+) this.Result (f value)
+ this.State <- this.State + 1
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State = 0 then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ this.Result <- LanguagePrimitives.DivideByInt<'U> this.Result this.State
+ override this.OnDispose () = () })
+
+ []
+ let exactlyOne (source:ISeq<'T>) : 'T =
+ source.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,'T,Values>(Unchecked.defaultof<'T>, Values(true, false)) with
+ override this.ProcessNext value =
+ if this.State._1 then
+ this.State._1 <- false
+ this.Result <- value
+ else
+ this.State._2 <- true
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State._1 then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ elif this.State._2 then
+ invalidArg "source" (SR.GetString SR.inputSequenceTooLong)
+ override this.OnDispose () = () })
+
+ []
+ let inline fold<'T,'State> (f:'State->'T->'State) (seed:'State) (source:ISeq<'T>) : 'State =
+ source.Fold (fun _ ->
+ { new Folder<'T,'State>(seed) with
+ override this.ProcessNext value =
+ this.Result <- f this.Result value
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline fold2<'T1,'T2,'State> (folder:'State->'T1->'T2->'State) (state:'State) (source1:ISeq<'T1>) (source2: ISeq<'T2>) =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<_,'State,IEnumerator<'T2>>(state,source2.GetEnumerator()) with
+ override this.ProcessNext value =
+ if this.State.MoveNext() then
+ this.Result <- folder this.Result value this.State.Current
+ else
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State.Dispose () })
+
+ []
+ let unfold (generator:'State->option<'T * 'State>) (state:'State) : ISeq<'T> =
+ upcast (new UnfoldEnumerable<'T,'T,'State>(generator, state, IdentityFactory.Instance, 1))
+
+ []
+ let initInfinite<'T> (f:int->'T) : ISeq<'T> =
+ upcast (new InitEnumerableDecider<'T>(Nullable (), f, 1))
+
+ []
+ let init<'T> (count:int) (f:int->'T) : ISeq<'T> =
+ if count < 0 then invalidArgInputMustBeNonNegative "count" count
+ elif count = 0 then empty else
+ upcast (new InitEnumerableDecider<'T>(Nullable count, f, 1))
+
+ []
+ let inline iter f (source:ISeq<'T>) =
+ source.Fold (fun _ ->
+ { new Folder<'T,unit> (()) with
+ override this.ProcessNext value =
+ f value
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline iter2 (f:'T->'U->unit) (source1:ISeq<'T>) (source2:ISeq<'U>) : unit =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,unit,IEnumerator<'U>> ((),source2.GetEnumerator()) with
+ override this.ProcessNext value =
+ if this.State.MoveNext() then
+ f value this.State.Current
+ else
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State.Dispose () })
+
+ []
+ let inline iteri2 (f:int->'T->'U->unit) (source1:ISeq<'T>) (source2:ISeq<'U>) : unit =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,unit,Values>>((),Values<_,_>(0,source2.GetEnumerator())) with
+ override this.ProcessNext value =
+ if this.State._2.MoveNext() then
+ f this.State._1 value this.State._2.Current
+ this.State._1 <- this.State._1 + 1
+ Unchecked.defaultof<_>
+ else
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_>
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State._2.Dispose () })
+
+ []
+ let tryHead (source:ISeq<'T>) =
+ source.Fold (fun pipeIdx ->
+ { new Folder<'T, Option<'T>> (None) with
+ override this.ProcessNext value =
+ this.Result <- Some value
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let head (source:ISeq<_>) =
+ match tryHead source with
+ | None -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ | Some x -> x
+
+ []
+ let inline iteri f (source:ISeq<'T>) =
+ source.Fold (fun _ ->
+ upcast { new FolderWithState<'T,unit,int> ((),0) with
+ override this.ProcessNext value =
+ f this.State value
+ this.State <- this.State + 1
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline except (itemsToExclude: seq<'T>) (source:ISeq<'T>) : ISeq<'T> when 'T:equality =
+ checkNonNull "itemsToExclude" itemsToExclude
+ source.PushTransform { new ITransformFactory<'T,'T> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,Lazy>>(next,lazy(HashSet<'T>(itemsToExclude,HashIdentity.Structural<'T>))) with
+ override this.ProcessNext (input:'T) : bool =
+ this.State.Value.Add input && TailCall.avoid (next.ProcessNext input) }}
+
+ []
+ let inline exists f (source:ISeq<'T>) =
+ source.Fold (fun pipeIdx ->
+ { new Folder<'T, bool> (false) with
+ override this.ProcessNext value =
+ if f value then
+ this.Result <- true
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline exists2 (predicate:'T->'U->bool) (source1:ISeq<'T>) (source2: ISeq<'U>) : bool =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,bool,IEnumerator<'U>>(false,source2.GetEnumerator()) with
+ override this.ProcessNext value =
+ if this.State.MoveNext() then
+ if predicate value this.State.Current then
+ this.Result <- true
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ else
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State.Dispose () })
+
+ []
+ let inline contains element (source:ISeq<'T>) =
+ source.Fold (fun pipeIdx ->
+ { new Folder<'T, bool> (false) with
+ override this.ProcessNext value =
+ if element = value then
+ this.Result <- true
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline forall predicate (source:ISeq<'T>) =
+ source.Fold (fun pipeIdx ->
+ { new Folder<'T, bool> (true) with
+ override this.ProcessNext value =
+ if not (predicate value) then
+ this.Result <- false
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *) })
+
+ []
+ let inline forall2 predicate (source1:ISeq<'T>) (source2:ISeq<'U>) : bool =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,bool,IEnumerator<'U>>(true,source2.GetEnumerator()) with
+ override this.ProcessNext value =
+ if this.State.MoveNext() then
+ if not (predicate value this.State.Current) then
+ this.Result <- false
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ else
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State.Dispose () })
+
+ []
+ let inline filter<'T> (f:'T->bool) (source:ISeq<'T>) : ISeq<'T> =
+ source.PushTransform { new ITransformFactory<'T,'T> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,NoValue>(next,Unchecked.defaultof) with
+ override __.ProcessNext input =
+ if f input then TailCall.avoid (next.ProcessNext input)
+ else false } }
+
+ []
+ let inline map<'T,'U> (f:'T->'U) (source:ISeq<'T>) : ISeq<'U> =
+ source.PushTransform { new ITransformFactory<'T,'U> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,NoValue>(next,Unchecked.defaultof) with
+ override __.ProcessNext input =
+ TailCall.avoid (next.ProcessNext (f input)) } }
+
+ []
+ let inline mapi f (source:ISeq<_>) =
+ source.PushTransform { new ITransformFactory<'T,'U> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,int>(next, -1) with
+ override this.ProcessNext (input:'T) : bool =
+ this.State <- this.State + 1
+ TailCall.avoid (next.ProcessNext (f this.State input)) } }
+
+ []
+ let inline map2<'T,'U,'V> (map:'T->'U->'V) (source1:ISeq<'T>) (source2:ISeq<'U>) : ISeq<'V> =
+ source1.PushTransform { new ITransformFactory<'T,'V> with
+ override __.Compose outOfBand pipeIdx (next:Activity<'V,'W>) =
+ upcast { new TransformWithPostProcessing<'T,'W, IEnumerator<'U>>(next, (source2.GetEnumerator ())) with
+ override this.ProcessNext input =
+ if this.State.MoveNext () then
+ TailCall.avoid (next.ProcessNext (map input this.State.Current))
+ else
+ outOfBand.StopFurtherProcessing pipeIdx
+ false
+ override this.OnComplete _ = ()
+ override this.OnDispose () = this.State.Dispose () }}
+
+ []
+ let inline mapi2<'T,'U,'V> (map:int->'T->'U->'V) (source1:ISeq<'T>) (source2:ISeq<'U>) : ISeq<'V> =
+ source1.PushTransform { new ITransformFactory<'T,'V> with
+ override __.Compose<'W> outOfBand pipeIdx next =
+ upcast { new TransformWithPostProcessing<'T,'W, Values>>(next, Values<_,_>(-1,source2.GetEnumerator ())) with
+ override this.ProcessNext t =
+ let idx : byref<_> = &this.State._1
+ let u = this.State._2
+ if u.MoveNext () then
+ idx <- idx + 1
+ TailCall.avoid (next.ProcessNext (map idx t u.Current))
+ else
+ outOfBand.StopFurtherProcessing pipeIdx
+ false
+ override this.OnDispose () = this.State._2.Dispose ()
+ override this.OnComplete _ = () }}
+
+ []
+ let inline map3<'T,'U,'V,'W>(map:'T->'U->'V->'W) (source1:ISeq<'T>) (source2:ISeq<'U>) (source3:ISeq<'V>) : ISeq<'W> =
+ source1.PushTransform { new ITransformFactory<'T,'W> with
+ override __.Compose<'X> outOfBand pipeIdx next =
+ upcast { new TransformWithPostProcessing<'T,'X,Values,IEnumerator<'V>>>(next,Values<_,_>(source2.GetEnumerator(),source3.GetEnumerator())) with
+ override this.ProcessNext t =
+ let u = this.State._1
+ let v = this.State._2
+ if u.MoveNext() && v.MoveNext () then
+ TailCall.avoid (next.ProcessNext (map t u.Current v.Current))
+ else
+ outOfBand.StopFurtherProcessing pipeIdx
+ false
+ override this.OnComplete _ = ()
+ override this.OnDispose () =
+ this.State._1.Dispose ()
+ this.State._2.Dispose () }}
+
+ []
+ let inline compareWith (f:'T->'T->int) (source1:ISeq<'T>) (source2:ISeq<'T>) : int =
+ source1.Fold (fun pipeIdx ->
+ upcast { new FolderWithPostProcessing<'T,int,IEnumerator<'T>>(0,source2.GetEnumerator()) with
+ override this.ProcessNext value =
+ if not (this.State.MoveNext()) then
+ this.Result <- 1
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ else
+ let c = f value this.State.Current
+ if c <> 0 then
+ this.Result <- c
+ (this :> IOutOfBand).StopFurtherProcessing pipeIdx
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+ override this.OnComplete _ =
+ if this.Result = 0 && this.State.MoveNext() then
+ this.Result <- -1
+ override this.OnDispose () = this.State.Dispose () })
+
+ []
+ let inline choose (f:'T->option<'U>) (source:ISeq<'T>) : ISeq<'U> =
+ source.PushTransform { new ITransformFactory<'T,'U> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,NoValue>(next,Unchecked.defaultof) with
+ override __.ProcessNext input =
+ match f input with
+ | Some value -> TailCall.avoid (next.ProcessNext value)
+ | None -> false } }
+
+ []
+ let inline distinct (source:ISeq<'T>) : ISeq<'T> when 'T:equality =
+ source.PushTransform { new ITransformFactory<'T,'T> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,HashSet<'T>>(next,HashSet HashIdentity.Structural) with
+ override this.ProcessNext (input:'T) : bool =
+ this.State.Add input && TailCall.avoid (next.ProcessNext input) }}
+
+ []
+ let inline distinctBy (keyf:'T->'Key) (source:ISeq<'T>) :ISeq<'T> when 'Key:equality =
+ source.PushTransform { new ITransformFactory<'T,'T> with
+ override __.Compose _ _ next =
+ upcast { new Transform<'T,'V,HashSet<'Key>> (next,HashSet HashIdentity.Structural) with
+ override this.ProcessNext (input:'T) : bool =
+ this.State.Add (keyf input) && TailCall.avoid (next.ProcessNext input) }}
+
+ []
+ let inline max (source:ISeq<'T>) : 'T when 'T:comparison =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'T,bool>(Unchecked.defaultof<'T>,true) with
+ override this.ProcessNext value =
+ if this.State then
+ this.State <- false
+ this.Result <- value
+ elif value > this.Result then
+ this.Result <- value
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ override this.OnDispose () = () })
+
+ []
+ let inline maxBy (f:'T->'U) (source:ISeq<'T>) : 'T when 'U:comparison =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'T,Values>(Unchecked.defaultof<'T>,Values<_,_>(true,Unchecked.defaultof<'U>)) with
+ override this.ProcessNext value =
+ match this.State._1, f value with
+ | true, valueU ->
+ this.State._1 <- false
+ this.State._2 <- valueU
+ this.Result <- value
+ | false, valueU when valueU > this.State._2 ->
+ this.State._2 <- valueU
+ this.Result <- value
+ | _ -> ()
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State._1 then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ override this.OnDispose () = () })
+
+ []
+ let inline min (source:ISeq<'T>) : 'T when 'T:comparison =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'T,bool>(Unchecked.defaultof<'T>,true) with
+ override this.ProcessNext value =
+ if this.State then
+ this.State <- false
+ this.Result <- value
+ elif value < this.Result then
+ this.Result <- value
+ Unchecked.defaultof<_> (* return value unused in Fold context *)
+
+ override this.OnComplete _ =
+ if this.State then
+ invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString
+ override this.OnDispose () = () })
+
+ []
+ let inline minBy (f:'T->'U) (source:ISeq<'T>) : 'T =
+ source.Fold (fun _ ->
+ upcast { new FolderWithPostProcessing<'T,'T,Values