Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb148529

Browse files
PatrickMcDonaldlatkin
authored andcommitted
Implement Array.windowed, List.windowed
commit c124af48c696ea90e3297a160a8cb832e6bc4610Author: latkin <latkin@microsoft.com>Date: Wed Nov 5 10:34:24 2014 -0800 Small corrections to XML docscommit abf3ad863e47ed36c0c183c1a2c7cceb46ad3596Merge:1d6fff2 ec5a221Author: latkin <latkin@microsoft.com>Date: Wed Nov 5 09:59:28 2014 -0800 Merge branch 'windowed' ofhttps://git01.codeplex.com/forks/patrickmcdonald/visualfsharp into PR Conflicts: src/fsharp/FSharp.Core/array.fs src/fsharp/FSharp.Core/array.fsicommit ec5a2218d97c2d15ba7c92bab978924f0f20e4ceAuthor: Patrick McDonald <paddymcdonald@gmail.com>Date: Tue Sep 16 00:40:53 2014 +0100 Fixes error where List.windowed 2 [1] returns [ [|1; 0|] ] Add additional testscommit 9aebd7d3419225e536cef44f729fed5c0d6637f2Author: Patrick McDonald <paddymcdonald@gmail.com>Date: Thu Sep 11 00:55:51 2014 +0100 Implement List.windowed and Array.windowed
1 parent1d6fff2 commitb148529

File tree

11 files changed

+266
-6
lines changed

11 files changed

+266
-6
lines changed

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Make sure each method works on:
1818
* Null array (null)
1919
*)
2020

21+
typeArrayWindowedTestInput<'t>=
22+
{
23+
InputArray:'t[]
24+
WindowSize:int
25+
ExpectedArray:'t[][]
26+
Exception:Type option
27+
}
28+
2129
[<TestFixture>]
2230
typeArrayModule2()=
2331

@@ -1001,6 +1009,96 @@ type ArrayModule2() =
10011009

10021010
()
10031011

1012+
[<Test>]
1013+
memberthis.Windowed()=
1014+
lettestWindowed config=
1015+
try
1016+
config.InputArray
1017+
|> Array.windowed config.WindowSize
1018+
|>(fun actual-> Assert.AreEqual(config.ExpectedArray,actual))
1019+
with
1020+
|_when Option.isNone config.Exception-> Assert.Fail()
1021+
| ewhen e.GetType()=(Option.get config.Exception)->()
1022+
|_-> Assert.Fail()
1023+
1024+
{
1025+
InputArray=[|1..10|]
1026+
WindowSize=1
1027+
ExpectedArray=[|for iin1..10doyield[| i|]|]
1028+
Exception= None
1029+
}|> testWindowed
1030+
{
1031+
InputArray=[|1..10|]
1032+
WindowSize=5
1033+
ExpectedArray=[|for iin1..6doyield[| i; i+1; i+2; i+3; i+4|]|]
1034+
Exception= None
1035+
}|> testWindowed
1036+
{
1037+
InputArray=[|1..10|]
1038+
WindowSize=10
1039+
ExpectedArray=[|yield[|1..10|]|]
1040+
Exception= None
1041+
}|> testWindowed
1042+
{
1043+
InputArray=[|1..10|]
1044+
WindowSize=25
1045+
ExpectedArray=[||]
1046+
Exception= None
1047+
}|> testWindowed
1048+
{
1049+
InputArray=[|"str1";"str2";"str3";"str4"|]
1050+
WindowSize=2
1051+
ExpectedArray=[|[|"str1";"str2"|];[|"str2";"str3"|];[|"str3";"str4"|]|]
1052+
Exception= None
1053+
}|> testWindowed
1054+
{
1055+
InputArray=[||]
1056+
WindowSize=2
1057+
ExpectedArray=[||]
1058+
Exception= None
1059+
}|> testWindowed
1060+
{
1061+
InputArray=null
1062+
WindowSize=2
1063+
ExpectedArray=[||]
1064+
Exception= Some typeof<ArgumentNullException>
1065+
}|> testWindowed
1066+
{
1067+
InputArray=[|1..10|]
1068+
WindowSize=0
1069+
ExpectedArray=[||]
1070+
Exception= Some typeof<ArgumentException>
1071+
}|> testWindowed
1072+
1073+
// expectedArrays indexed by arraySize,windowSize
1074+
letexpectedArrays= Array2D.zeroCreate66
1075+
expectedArrays.[1,1]<-[|[|1|]|]
1076+
expectedArrays.[2,1]<-[|[|1|];[|2|]|]
1077+
expectedArrays.[2,2]<-[|[|1;2|]|]
1078+
expectedArrays.[3,1]<-[|[|1|];[|2|];[|3|]|]
1079+
expectedArrays.[3,2]<-[|[|1;2|];[|2;3|]|]
1080+
expectedArrays.[3,3]<-[|[|1;2;3|]|]
1081+
expectedArrays.[4,1]<-[|[|1|];[|2|];[|3|];[|4|]|]
1082+
expectedArrays.[4,2]<-[|[|1;2|];[|2;3|];[|3;4|]|]
1083+
expectedArrays.[4,3]<-[|[|1;2;3|];[|2;3;4|]|]
1084+
expectedArrays.[4,4]<-[|[|1;2;3;4|]|]
1085+
expectedArrays.[5,1]<-[|[|1|];[|2|];[|3|];[|4|];[|5|]|]
1086+
expectedArrays.[5,2]<-[|[|1;2|];[|2;3|];[|3;4|];[|4;5|]|]
1087+
expectedArrays.[5,3]<-[|[|1;2;3|];[|2;3;4|];[|3;4;5|]|]
1088+
expectedArrays.[5,4]<-[|[|1;2;3;4|];[|2;3;4;5|]|]
1089+
expectedArrays.[5,5]<-[|[|1;2;3;4;5|]|]
1090+
1091+
for arraySize=0to5do
1092+
for windowSize=-1to5do
1093+
if windowSize<=0then
1094+
CheckThrowsArgumentException(fun()-> Array.windowed windowSize[|1..arraySize|]|> ignore)
1095+
elif arraySize< windowSizethen
1096+
Assert.AreEqual([||], Array.windowed windowSize[|1..arraySize|])
1097+
else
1098+
Assert.AreEqual(expectedArrays.[arraySize, windowSize], Array.windowed windowSize[|1..arraySize|])
1099+
1100+
()
1101+
10041102
[<Test>]
10051103
memberthis.Zero_Create()=
10061104

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Make sure each method works on:
1818
* Empty List (0 elements)
1919
*)
2020

21+
typeListWindowedTestInput<'t>=
22+
{
23+
InputList:'t list
24+
WindowSize:int
25+
ExpectedList:'t[] list
26+
Exception:Type option
27+
}
28+
2129
[<TestFixture>]
2230
typeListModule02()=
2331
[<Test>]
@@ -867,6 +875,90 @@ type ListModule02() =
867875

868876
()
869877

878+
[<Test>]
879+
memberthis.Windowed()=
880+
lettestWindowed config=
881+
try
882+
config.InputList
883+
|> List.windowed config.WindowSize
884+
|>(fun actual-> Assert.AreEqual(config.ExpectedList,actual))
885+
with
886+
|_when Option.isNone config.Exception-> Assert.Fail()
887+
| ewhen e.GetType()=(Option.get config.Exception)->()
888+
|_-> Assert.Fail()
889+
890+
{
891+
InputList=[1..10]
892+
WindowSize=1
893+
ExpectedList=[for iin1..10doyield[| i|]]
894+
Exception= None
895+
}|> testWindowed
896+
{
897+
InputList=[1..10]
898+
WindowSize=5
899+
ExpectedList=[for iin1..6doyield[| i; i+1; i+2; i+3; i+4|]]
900+
Exception= None
901+
}|> testWindowed
902+
{
903+
InputList=[1..10]
904+
WindowSize=10
905+
ExpectedList=[yield[|1..10|]]
906+
Exception= None
907+
}|> testWindowed
908+
{
909+
InputList=[1..10]
910+
WindowSize=25
911+
ExpectedList=[]
912+
Exception= None
913+
}|> testWindowed
914+
{
915+
InputList=["str1";"str2";"str3";"str4"]
916+
WindowSize=2
917+
ExpectedList=[[|"str1";"str2"|];[|"str2";"str3"|];[|"str3";"str4"|]]
918+
Exception= None
919+
}|> testWindowed
920+
{
921+
InputList=[]
922+
WindowSize=2
923+
ExpectedList=[]
924+
Exception= None
925+
}|> testWindowed
926+
{
927+
InputList=[1..10]
928+
WindowSize=0
929+
ExpectedList=[]
930+
Exception= Some typeof<ArgumentException>
931+
}|> testWindowed
932+
933+
// expectedLists indexed by arraySize,windowSize
934+
letexpectedLists= Array2D.zeroCreate66
935+
expectedLists.[1,1]<-[[|1|]]
936+
expectedLists.[2,1]<-[[|1|];[|2|]]
937+
expectedLists.[2,2]<-[[|1;2|]]
938+
expectedLists.[3,1]<-[[|1|];[|2|];[|3|]]
939+
expectedLists.[3,2]<-[[|1;2|];[|2;3|]]
940+
expectedLists.[3,3]<-[[|1;2;3|]]
941+
expectedLists.[4,1]<-[[|1|];[|2|];[|3|];[|4|]]
942+
expectedLists.[4,2]<-[[|1;2|];[|2;3|];[|3;4|]]
943+
expectedLists.[4,3]<-[[|1;2;3|];[|2;3;4|]]
944+
expectedLists.[4,4]<-[[|1;2;3;4|]]
945+
expectedLists.[5,1]<-[[|1|];[|2|];[|3|];[|4|];[|5|]]
946+
expectedLists.[5,2]<-[[|1;2|];[|2;3|];[|3;4|];[|4;5|]]
947+
expectedLists.[5,3]<-[[|1;2;3|];[|2;3;4|];[|3;4;5|]]
948+
expectedLists.[5,4]<-[[|1;2;3;4|];[|2;3;4;5|]]
949+
expectedLists.[5,5]<-[[|1;2;3;4;5|]]
950+
951+
for arraySize=0to5do
952+
for windowSize=-1to5do
953+
if windowSize<=0then
954+
CheckThrowsArgumentException(fun()-> List.windowed windowSize[1..arraySize]|> ignore)
955+
elif arraySize< windowSizethen
956+
Assert.AreEqual([], List.windowed windowSize[1..arraySize])
957+
else
958+
Assert.AreEqual(expectedLists.[arraySize, windowSize], List.windowed windowSize[1..arraySize])
959+
960+
()
961+
870962
[<Test>]
871963
memberthis.Zip()=
872964
// integer List

‎src/fsharp/FSharp.Core.Unittests/SurfaceArea.4.0.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Microsoft.FSharp.Collections.ArrayModule: T[] Truncate[T](Int32, T[])
189189
Microsoft.FSharp.Collections.ArrayModule: T[] Unfold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState)
190190
Microsoft.FSharp.Collections.ArrayModule: T[] Where[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[])
191191
Microsoft.FSharp.Collections.ArrayModule: T[] ZeroCreate[T](Int32)
192+
Microsoft.FSharp.Collections.ArrayModule: T[][] Windowed[T](Int32, T[])
192193
Microsoft.FSharp.Collections.ArrayModule: Void CopyTo[T](T[], Int32, T[], Int32, Int32)
193194
Microsoft.FSharp.Collections.ArrayModule: Void Fill[T](T[], Int32, Int32, T)
194195
Microsoft.FSharp.Collections.ArrayModule: Void Iterate2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]], T1[], T2[])
@@ -317,6 +318,7 @@ Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList
317318
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T])
318319
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.FSharpList`1[T], TState)
319320
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] Scan[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpList`1[T])
321+
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T[]] Windowed[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T])
320322
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Append[T](Microsoft.FSharp.Collections.FSharpList`1[T], Microsoft.FSharp.Collections.FSharpList`1[T])
321323
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Concat[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]])
322324
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T])

‎src/fsharp/FSharp.Core.Unittests/SurfaceArea.Portable.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Microsoft.FSharp.Collections.ArrayModule: T[] Truncate[T](Int32, T[])
183183
Microsoft.FSharp.Collections.ArrayModule: T[] Unfold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState)
184184
Microsoft.FSharp.Collections.ArrayModule: T[] Where[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[])
185185
Microsoft.FSharp.Collections.ArrayModule: T[] ZeroCreate[T](Int32)
186+
Microsoft.FSharp.Collections.ArrayModule: T[][] Windowed[T](Int32, T[])
186187
Microsoft.FSharp.Collections.ArrayModule: Void CopyTo[T](T[], Int32, T[], Int32, Int32)
187188
Microsoft.FSharp.Collections.ArrayModule: Void Fill[T](T[], Int32, Int32, T)
188189
Microsoft.FSharp.Collections.ArrayModule: Void Iterate2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]], T1[], T2[])
@@ -311,6 +312,7 @@ Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList
311312
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T])
312313
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.FSharpList`1[T], TState)
313314
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] Scan[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpList`1[T])
315+
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T[]] Windowed[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T])
314316
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Append[T](Microsoft.FSharp.Collections.FSharpList`1[T], Microsoft.FSharp.Collections.FSharpList`1[T])
315317
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Concat[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]])
316318
Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T])

‎src/fsharp/FSharp.Core/array.fs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,19 @@ namespace Microsoft.FSharp.Collections
569569
checkNonNull"array" array
570570
Microsoft.FSharp.Primitives.Basics.Array.tryFindIndexBack f array
571571

572+
[<CompiledName("Windowed")>]
573+
letwindowed windowSize(array:'T[])=
574+
checkNonNull"array" array
575+
if windowSize<=0then invalidArg"windowSize"(SR.GetString(SR.inputMustBeNonNegative))
576+
letlen= array.Length
577+
if windowSize> lenthen
578+
[||]
579+
else
580+
letres= Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked(len- windowSize+1): 'T[][]
581+
for i=0to len- windowSizedo
582+
res.[i]<- array.[i..i+windowSize-1]
583+
res
584+
572585
[<CompiledName("Zip")>]
573586
letzip(array1:_[])(array2:_[])=
574587
checkNonNull"array1" array1

‎src/fsharp/FSharp.Core/array.fsi‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,16 @@ namespace Microsoft.FSharp.Collections
945945
[<CompiledName("Where")>]
946946
val where:predicate:('T->bool)->array:'T[]-> 'T[]
947947

948+
///<summary>Returns an array of sliding windows containing elements drawn from the input
949+
///array. Each window is returned as a fresh array.</summary>
950+
///<param name="windowSize">The number of elements in each window.</param>
951+
///<param name="array">The input array.</param>
952+
///<returns>The result array.</returns>
953+
///<exception cref="System.ArgumentNullException">Thrown when the input array is null.</exception>
954+
///<exception cref="System.ArgumentException">Thrown when windowSize is not positive.</exception>
955+
[<CompiledName("Windowed")>]
956+
val windowed:windowSize:int->array:'T[]-> 'T[][]
957+
948958
///<summary>Combines the two arrays into an array of pairs. The two arrays must have equal lengths,otherwise an <c>ArgumentException</c> is
949959
///raised.</summary>
950960
///<param name="array1">The first input array.</param>

‎src/fsharp/FSharp.Core/list.fs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ namespace Microsoft.FSharp.Collections
456456
[<CompiledName("Unzip3")>]
457457
letunzip3 x= Microsoft.FSharp.Primitives.Basics.List.unzip3 x
458458

459+
[<CompiledName("Windowed")>]
460+
letwindowed n x= Microsoft.FSharp.Primitives.Basics.List.windowed n x
461+
459462
[<CompiledName("Zip")>]
460463
letzip x1 x2= Microsoft.FSharp.Primitives.Basics.List.zip x1 x2
461464

@@ -575,4 +578,4 @@ namespace Microsoft.FSharp.Collections
575578
lettruncate count list= Microsoft.FSharp.Primitives.Basics.List.truncate count list
576579

577580
[<CompiledName("Unfold")>]
578-
letunfold<'T,'State>(f:'State->('T*'State)option)(s:'State)= Microsoft.FSharp.Primitives.Basics.List.unfold f s
581+
letunfold<'T,'State>(f:'State->('T*'State)option)(s:'State)= Microsoft.FSharp.Primitives.Basics.List.unfold f s

‎src/fsharp/FSharp.Core/list.fsi‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,15 @@ namespace Microsoft.FSharp.Collections
819819
[<CompiledName("Where")>]
820820
val where:predicate:('T->bool)->list:'T list-> 'T list
821821

822+
///<summary>Returns a list of sliding windows containing elements drawn from the input
823+
///list. Each window is returned as a fresh array.</summary>
824+
///<param name="windowSize">The number of elements in each window.</param>
825+
///<param name="list">The input list.</param>
826+
///<returns>The result list.</returns>
827+
///<exception cref="System.ArgumentException">Thrown when windowSize is not positive.</exception>
828+
[<CompiledName("Windowed")>]
829+
val windowed:windowSize:int->list:'T list-> 'T[]list
830+
822831
///<summary>Combines the two lists into a list of pairs. The two lists must have equal lengths.</summary>
823832
///<param name="list1">The first input list.</param>
824833
///<param name="list2">The second input list.</param>

‎src/fsharp/FSharp.Core/local.fs‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,39 @@ module internal List =
499499
unzip3ToFreshConsTail res1a res1b res1c t;
500500
res1a,res1b,res1c
501501

502+
let recwindowedToFreshConsTail cons windowSize i l(arr:'T[])=
503+
match lwith
504+
|[]-> setFreshConsTail cons[]
505+
| h::t->
506+
arr.[i]<- h
507+
leti=(i+1)% windowSize
508+
letresult= arrayZeroCreate windowSize: 'T[]
509+
System.Array.Copy(arr, i, result,0, windowSize- i)
510+
System.Array.Copy(arr,0, result, windowSize- i, i)
511+
letcons2= freshConsNoTail result
512+
setFreshConsTail cons cons2
513+
windowedToFreshConsTail cons2 windowSize i t arr
514+
515+
letwindowed windowSize list=
516+
if windowSize<=0then invalidArg"windowSize"(SR.GetString(SR.inputMustBeNonNegative))
517+
match listwith
518+
|[]->[]
519+
|_->
520+
letarr= arrayZeroCreate windowSize
521+
let recloop i r l=
522+
match lwith
523+
|[]->if r=0&& i= windowSizethen[arr.Clone():?> 'T[]]else[]
524+
| h::t->
525+
arr.[i]<- h
526+
if r=0then
527+
letcons= freshConsNoTail(arr.Clone():?> 'T[])
528+
windowedToFreshConsTail cons windowSize0 t arr
529+
cons
530+
else
531+
loop(i+1)(r-1) t
532+
533+
loop0(windowSize-1) list
534+
502535
// optimized mutation-based implementation. This code is only valid in fslib, where mutation of private
503536
// tail cons cells is permitted in carefully written library code.
504537
let reczipToFreshConsTail cons xs1 xs2=

‎src/fsharp/FSharp.Core/local.fsi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module internal List =
2727
val unfold:('State->('T* 'State) option)-> 'State-> 'T list
2828
val unzip:('T1* 'T2) list-> 'T1 list* 'T2 list
2929
val unzip3:('T1* 'T2* 'T3) list-> 'T1 list* 'T2 list* 'T3 list
30+
val windowed: int-> 'T list-> 'T[] list
3031
val zip: 'T1 list-> 'T2 list->('T1* 'T2) list
3132
val zip3: 'T1 list-> 'T2 list-> 'T3 list->('T1* 'T2* 'T3) list
3233
val ofArray: 'T[]-> 'T list

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp