forked from fsharp/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.fsi
More file actions
executable file
·714 lines (629 loc) · 42.9 KB
/
Copy patharray.fsi
File metadata and controls
executable file
·714 lines (629 loc) · 42.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
//----------------------------------------------------------------------------
//
// Copyright (c) 2002-2012 Microsoft Corporation.
//
// This source code is subject to terms and conditions of the Apache License, Version 2.0. A
// copy of the license can be found in the License.html file at the root of this distribution.
// By using this source code in any fashion, you are agreeing to be bound
// by the terms of the Apache License, Version 2.0.
//
// You must not remove this notice, or any other, from this software.
//----------------------------------------------------------------------------
namespace Microsoft.FSharp.Collections
open System
open Microsoft.FSharp.Core
open Microsoft.FSharp.Collections
open System.Collections.Generic
/// <summary>Basic operations on arrays.</summary>
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
[<RequireQualifiedAccess>]
module Array =
/// <summary>Builds a new array that contains the elements of the first array followed by the elements of the second array.</summary>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <returns>The resulting array.</returns>
[<CompiledName("Append")>]
val append: array1:'T[] -> array2:'T[] -> 'T[]
/// <summary>Returns the average of the elements in the array.</summary>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when <c>array</c> is empty.</exception>
/// <returns>The average of the elements in the array.</returns>
[<CompiledName("Average")>]
val inline average : array:^T[] -> ^T
when ^T : (static member ( + ) : ^T * ^T -> ^T)
and ^T : (static member DivideByInt : ^T*int -> ^T)
and ^T : (static member Zero : ^T)
/// <summary>Returns the average of the elements generated by applying the function to each element of the array.</summary>
/// <param name="projection">The function to transform the array elements before averaging.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when <c>array</c> is empty.</exception>
/// <returns>The computed average.</returns>
[<CompiledName("AverageBy")>]
val inline averageBy : projection:('T -> ^U) -> array:'T[] -> ^U
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member DivideByInt : ^U*int -> ^U)
and ^U : (static member Zero : ^U)
/// <summary>Reads a range of elements from the first array and write them into the second.</summary>
/// <param name="source">The source array.</param>
/// <param name="sourceIndex">The starting index of the source array.</param>
/// <param name="target">The target array.</param>
/// <param name="targetIndex">The starting index of the target array.</param>
/// <param name="count">The number of elements to copy.</param>
[<CompiledName("CopyTo")>]
val blit: source:'T[] -> sourceIndex:int -> target:'T[] -> targetIndex:int -> count:int -> unit
/// <summary>For each element of the array, applies the given function. Concatenates all the results and return the combined array.</summary>
/// <param name="mapping">The function to create sub-arrays from the input array elements.</param>
/// <param name="array">The input array.</param>
/// <returns>The concatenation of the sub-arrays.</returns>
[<CompiledName("Collect")>]
val collect : mapping:('T -> 'U[]) -> array:'T[] -> 'U[]
/// <summary>Builds a new array that contains the elements of each of the given sequence of arrays.</summary>
/// <param name="arrays">The input sequence of arrays.</param>
/// <returns>The concatenation of the sequence of input arrays.</returns>
[<CompiledName("Concat")>]
val concat: arrays:seq<'T[]> -> 'T[]
/// <summary>Builds a new array that contains the elements of the given array.</summary>
/// <param name="array">The input array.</param>
/// <returns>A copy of the input array.</returns>
[<CompiledName("Copy")>]
val copy: array:'T[] -> 'T[]
/// <summary>Creates an array whose elements are all initially the given value.</summary>
/// <param name="count">The length of the array to create.</param>
/// <param name="value">The value for the elements.</param>
/// <returns>The created array.</returns>
[<CompiledName("Create")>]
val create: count:int -> value:'T -> 'T[]
/// <summary>Applies the given function to successive elements, returning the first
/// result where function returns <c>Some(x)</c> for some <c>x</c>. If the function
/// never returns <c>Some(x)</c> then <c>None</c> is returned.</summary>
/// <param name="chooser">The function to transform the array elements into options.</param>
/// <param name="array">The input array.</param>
/// <returns>The first transformed element that is <c>Some(x)</c>.</returns>
[<CompiledName("TryPick")>]
val tryPick: chooser:('T -> 'U option) -> array:'T[] -> 'U option
/// <summary>Fills a range of elements of the array with the given value.</summary>
/// <param name="target">The target array.</param>
/// <param name="targetIndex">The index of the first element to set.</param>
/// <param name="count">The number of elements to set.</param>
/// <param name="value">The value to set.</param>
[<CompiledName("Fill")>]
val fill: target:'T[] -> targetIndex:int -> count:int -> value:'T -> unit
/// <summary>Applies the given function to successive elements, returning the first
/// result where function returns <c>Some(x)</c> for some <c>x</c>. If the function
/// never returns <c>Some(x)</c> then <c>KeyNotFoundException</c> is raised.</summary>
/// <param name="chooser">The function to generate options from the elements.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if every result from
/// <c>chooser</c> is <c>None</c>.</exception>
/// <returns>The first result.</returns>
[<CompiledName("Pick")>]
val pick: chooser:('T -> 'U option) -> array:'T[] -> 'U
/// <summary>Applies the given function to each element of the array. Returns
/// the array comprised of the results "x" for each element where
/// the function returns Some(x)</summary>
/// <param name="chooser">The function to generate options from the elements.</param>
/// <param name="array">The input array.</param>
/// <returns>The array of results.</returns>
[<CompiledName("Choose")>]
val choose: chooser:('T -> 'U option) -> array:'T[] -> 'U[]
/// <summary>Returns an empty array of the given type.</summary>
[<GeneralizableValue>]
[<CompiledName("Empty")>]
val empty<'T> : 'T[]
/// <summary>Tests if any element of the array satisfies the given predicate.</summary>
///
/// <remarks>The predicate is applied to the elements of the input array. If any application
/// returns true then the overall result is true and no further elements are tested.
/// Otherwise, false is returned.</remarks>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>True if any result from <c>predicate</c> is true.</returns>
[<CompiledName("Exists")>]
val exists: predicate:('T -> bool) -> array:'T[] -> bool
/// <summary>Tests if any pair of corresponding elements of the arrays satisfies the given predicate.</summary>
///
/// <remarks>The predicate is applied to matching elements in the two collections up to the lesser of the
/// two lengths of the collections. If any application returns true then the overall result is
/// true and no further elements are tested. Otherwise, if one collections is longer
/// than the other then the <c>ArgumentException</c> exception is raised.
/// Otherwise, false is returned.</remarks>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <returns>True if any result from <c>predicate</c> is true.</returns>
[<CompiledName("Exists2")>]
val exists2: predicate:('T1 -> 'T2 -> bool) -> array1:'T1[] -> array2:'T2[] -> bool
/// <summary>Returns a new collection containing only the elements of the collection
/// for which the given predicate returns "true".</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>An array containing the elements for which the given predicate returns true.</returns>
[<CompiledName("Filter")>]
val filter: predicate:('T -> bool) -> array:'T[] -> 'T[]
/// <summary>Returns the first element for which the given function returns 'true'.
/// Raise <c>KeyNotFoundException</c> if no such element exists.</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if <c>predicate</c>
/// never returns true.</exception>
/// <returns>The first element for which <c>predicate</c> returns true.</returns>
[<CompiledName("Find")>]
val find: predicate:('T -> bool) -> array:'T[] -> 'T
/// <summary>Returns the index of the first element in the array
/// that satisfies the given predicate. Raise <c>KeyNotFoundException</c> if
/// none of the elements satisy the predicate.</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if <c>predicate</c>
/// never returns true.</exception>
/// <returns>The index of the first element in the array that satisfies the given predicate.</returns>
[<CompiledName("FindIndex")>]
val findIndex: predicate:('T -> bool) -> array:'T[] -> int
/// <summary>Tests if all elements of the array satisfy the given predicate.</summary>
///
/// <remarks>The predicate is applied to the elements of the input collection. If any application
/// returns false then the overall result is false and no further elements are tested.
/// Otherwise, true is returned.</remarks>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>True if all of the array elements satisfy the predicate.</returns>
[<CompiledName("ForAll")>]
val forall: predicate:('T -> bool) -> array:'T[] -> bool
/// <summary>Tests if all corresponding elements of the array satisfy the given predicate pairwise.</summary>
///
/// <remarks>The predicate is applied to matching elements in the two collections up to the lesser of the
/// two lengths of the collections. If any application returns false then the overall result is
/// false and no further elements are tested. Otherwise, if one collection is longer
/// than the other then the <c>ArgumentException</c> exception is raised.
/// Otherwise, true is returned.</remarks>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>True if all of the array elements satisfy the predicate.</returns>
[<CompiledName("ForAll2")>]
val forall2: predicate:('T1 -> 'T2 -> bool) -> array1:'T1[] -> array2:'T2[] -> bool
/// <summary>Applies a function to each element of the collection, threading an accumulator argument
/// through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c> then computes
/// <c>f (... (f s i0)...) iN</c></summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="state">The initial state.</param>
/// <param name="array">The input array.</param>
/// <returns>The final state.</returns>
[<CompiledName("Fold")>]
val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> array: 'T[] -> 'State
/// <summary>Applies a function to each element of the array, threading an accumulator argument
/// through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c> then computes
/// <c>f i0 (...(f iN s))</c></summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="array">The input array.</param>
/// <param name="state">The initial state.</param>
/// <returns>The final state.</returns>
[<CompiledName("FoldBack")>]
val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> array:'T[] -> state:'State -> 'State
/// <summary>Applies a function to pairs of elements drawn from the two collections,
/// left-to-right, threading an accumulator argument
/// through the computation. The two input
/// arrays must have the same lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="state">The initial state.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The final state.</returns>
[<CompiledName("Fold2")>]
val fold2<'T1,'T2,'State> : folder:('State -> 'T1 -> 'T2 -> 'State) -> state:'State -> array1:'T1[] -> array2:'T2[] -> 'State
/// <summary>Apply a function to pairs of elements drawn from the two collections, right-to-left,
/// threading an accumulator argument through the computation. The two input
/// arrays must have the same lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <param name="state">The initial state.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The final state.</returns>
[<CompiledName("FoldBack2")>]
val foldBack2<'T1,'T2,'State> : folder:('T1 -> 'T2 -> 'State -> 'State) -> array1:'T1[] -> array2:'T2[] -> state:'State -> 'State
/// <summary>Gets an element from an array.</summary>
/// <param name="array">The input array.</param>
/// <param name="index">The input index.</param>
/// <returns>The value of the array at the given index.</returns>
[<CompiledName("Get")>]
val get: array:'T[] -> index:int -> 'T
/// <summary>Creates an array given the dimension and a generator function to compute the elements.</summary>
/// <param name="count">The number of elements to initialize.</param>
/// <param name="initializer">The function to generate the initial values for each index.</param>
/// <returns>The created array.</returns>
[<CompiledName("Initialize")>]
val inline init: count:int -> initializer:(int -> 'T) -> 'T[]
/// <summary>Creates an array where the entries are initially the default value Unchecked.defaultof<'T>.</summary>
/// <param name="count">The length of the array to create.</param>
/// <returns>The created array.</returns>
[<CompiledName("ZeroCreate")>]
val zeroCreate: count:int -> 'T[]
/// <summary>Returns true if the given array is empty, otherwise false.</summary>
/// <param name="array">The input array.</param>
/// <returns>True if the array is empty.</returns>
[<CompiledName("IsEmpty")>]
val isEmpty: array:'T[] -> bool
/// <summary>Applies the given function to each element of the array.</summary>
/// <param name="action">The function to apply.</param>
/// <param name="array">The input array.</param>
[<CompiledName("Iterate")>]
val inline iter: action:('T -> unit) -> array:'T[] -> unit
/// <summary>Applies the given function to pair of elements drawn from matching indices in two arrays. The
/// two arrays must have the same lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="action">The function to apply.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
[<CompiledName("Iterate2")>]
val iter2: action:('T1 -> 'T2 -> unit) -> array1:'T1[] -> array2:'T2[] -> unit
/// <summary>Applies the given function to each element of the array. The integer passed to the
/// function indicates the index of element.</summary>
/// <param name="action">The function to apply to each index and element.</param>
/// <param name="array">The input array.</param>
[<CompiledName("IterateIndexed")>]
val iteri: action:(int -> 'T -> unit) -> array:'T[] -> unit
/// <summary>Applies the given function to pair of elements drawn from matching indices in two arrays,
/// also passing the index of the elements. The two arrays must have the same lengths,
/// otherwise an <c>ArgumentException</c> is raised.</summary>
/// <param name="action">The function to apply to each index and pair of elements.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
[<CompiledName("IterateIndexed2")>]
val iteri2: action:(int -> 'T1 -> 'T2 -> unit) -> array1:'T1[] -> array2:'T2[] -> unit
/// <summary>Returns the length of an array. You can also use property arr.Length.</summary>
/// <param name="array">The input array.</param>
/// <returns>The length of the array.</returns>
[<CompiledName("Length")>]
val length: array:'T[] -> int
/// <summary>Builds a new array whose elements are the results of applying the given function
/// to each of the elements of the array.</summary>
/// <param name="mapping">The function to transform elements of the array.</param>
/// <param name="array">The input array.</param>
/// <returns>The array of transformed elements.</returns>
[<CompiledName("Map")>]
val inline map: mapping:('T -> 'U) -> array:'T[] -> 'U[]
/// <summary>Builds a new collection whose elements are the results of applying the given function
/// to the corresponding elements of the two collections pairwise. The two input
/// arrays must have the same lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="mapping">The function to transform the pairs of the input elements.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The array of transformed elements.</returns>
[<CompiledName("Map2")>]
val map2: mapping:('T1 -> 'T2 -> 'U) -> array1:'T1[] -> array2:'T2[] -> 'U[]
/// <summary>Builds a new collection whose elements are the results of applying the given function
/// to the corresponding elements of the two collections pairwise, also passing the index of
/// the elements. The two input arrays must have the same lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="mapping">The function to transform pairs of input elements and their indices.</param>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The array of transformed elements.</returns>
[<CompiledName("MapIndexed2")>]
val mapi2: mapping:(int -> 'T1 -> 'T2 -> 'U) -> array1:'T1[] -> array2:'T2[] -> 'U[]
/// <summary>Builds a new array whose elements are the results of applying the given function
/// to each of the elements of the array. The integer index passed to the
/// function indicates the index of element being transformed.</summary>
/// <param name="mapping">The function to transform elements and their indices.</param>
/// <param name="array">The input array.</param>
/// <returns>The array of transformed elements.</returns>
[<CompiledName("MapIndexed")>]
val mapi: mapping:(int -> 'T -> 'U) -> array:'T[] -> 'U[]
/// <summary>Returns the greatest of all elements of the array, compared via Operators.max on the function result.</summary>
///
/// <remarks>Throws ArgumentException for empty arrays.</remarks>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The maximum element.</returns>
[<CompiledName("Max")>]
val inline max : array:'T[] -> 'T when 'T : comparison
/// <summary>Returns the greatest of all elements of the array, compared via Operators.max on the function result.</summary>
///
/// <remarks>Throws ArgumentException for empty arrays.</remarks>
/// <param name="projection">The function to transform the elements into a type supporting comparison.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The maximum element.</returns>
[<CompiledName("MaxBy")>]
val inline maxBy : projection:('T -> 'U) -> array:'T[] -> 'T when 'U : comparison
/// <summary>Returns the lowest of all elements of the array, compared via Operators.min.</summary>
///
/// <remarks>Throws ArgumentException for empty arrays</remarks>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The minimum element.</returns>
[<CompiledName("Min")>]
val inline min : array:'T[] -> 'T when 'T : comparison
/// <summary>Returns the lowest of all elements of the array, compared via Operators.min on the function result.</summary>
///
/// <remarks>Throws ArgumentException for empty arrays.</remarks>
/// <param name="projection">The function to transform the elements into a type supporting comparison.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The minimum element.</returns>
[<CompiledName("MinBy")>]
val inline minBy : projection:('T -> 'U) -> array:'T[] -> 'T when 'U : comparison
/// <summary>Builds an array from the given list.</summary>
/// <param name="list">The input list.</param>
/// <returns>The array of elements from the list.</returns>
[<CompiledName("OfList")>]
val ofList: list:'T list -> 'T[]
/// <summary>Builds a new array from the given enumerable object.</summary>
/// <param name="source">The input sequence.</param>
/// <returns>The array of elements from the sequence.</returns>
[<CompiledName("OfSeq")>]
val ofSeq: source:seq<'T> -> 'T[]
/// <summary>Splits the collection into two collections, containing the
/// elements for which the given predicate returns "true" and "false"
/// respectively.</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>A pair of arrays. The first containing the elements the predicate evaluated to true,
/// and the second containing those evaluated to false.</returns>
[<CompiledName("Partition")>]
val partition: predicate:('T -> bool) -> array:'T[] -> 'T[] * 'T[]
/// <summary>Returns an array with all elements permuted according to the
/// specified permutation.</summary>
/// <param name="indexMap">The function that maps input indices to output indices.</param>
/// <param name="array">The input array.</param>
/// <returns>The output array.</returns>
[<CompiledName("Permute")>]
val permute : indexMap:(int -> int) -> array:'T[] -> 'T[]
/// <summary>Applies a function to each element of the array, threading an accumulator argument
/// through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c>
/// then computes <c>f (... (f i0 i1)...) iN</c>.
/// Raises ArgumentException if the array has size zero.</summary>
/// <param name="reduction">The function to reduce a pair of elements to a single element.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The final result of the redcutions.</returns>
[<CompiledName("Reduce")>]
val reduce: reduction:('T -> 'T -> 'T) -> array:'T[] -> 'T
/// <summary>Applies a function to each element of the array, threading an accumulator argument
/// through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c>
/// then computes <c>f i0 (...(f iN-1 iN))</c>.
/// Raises ArgumentException if the array has size zero.</summary>
/// <param name="reduction">The function to reduce a pair of elements to a single element.</param>
/// <param name="array">The input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input array is empty.</exception>
/// <returns>The final result of the reductions.</returns>
[<CompiledName("ReduceBack")>]
val reduceBack: reduction:('T -> 'T -> 'T) -> array:'T[] -> 'T
/// <summary>Returns a new array with the elements in reverse order.</summary>
/// <param name="array">The input array.</param>
/// <returns>The reversed array.</returns>
[<CompiledName("Reverse")>]
val rev: array:'T[] -> 'T[]
/// <summary>Like <c>fold</c>, but return the intermediary and final results.</summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="state">The initial state.</param>
/// <param name="array">The input array.</param>
/// <returns>The array of state values.</returns>
[<CompiledName("Scan")>]
val scan<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> array:'T[] -> 'State[]
/// <summary>Like <c>foldBack</c>, but return both the intermediary and final results.</summary>
/// <param name="folder">The function to update the state given the input elements.</param>
/// <param name="array">The input array.</param>
/// <param name="state">The initial state.</param>
/// <returns>The array of state values.</returns>
[<CompiledName("ScanBack")>]
val scanBack<'T,'State> : folder:('T -> 'State -> 'State) -> array:'T[] -> state:'State -> 'State[]
/// <summary>Sets an element of an array.</summary>
/// <param name="array">The input array.</param>
/// <param name="index">The input index.</param>
/// <param name="value">The input value.</param>
[<CompiledName("Set")>]
val set: array:'T[] -> index:int -> value:'T -> unit
/// <summary>Builds a new array that contains the given subrange specified by
/// starting index and length.</summary>
/// <param name="array">The input array.</param>
/// <param name="startIndex">The index of the first element of the sub array.</param>
/// <param name="count">The length of the sub array.</param>
/// <returns>The created sub array.</returns>
[<CompiledName("GetSubArray")>]
val sub: array:'T[] -> startIndex:int -> count:int -> 'T[]
/// <summary>Sorts the elements of an array, returning a new array. Elements are compared using Operators.compare. </summary>
///
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
/// For a stable sort, consider using Seq.sort.</remarks>
/// <param name="array">The input array.</param>
/// <returns>The sorted array.</returns>
[<CompiledName("Sort")>]
val sort: array:'T[] -> 'T[] when 'T : comparison
/// <summary>Sorts the elements of an array, using the given projection for the keys and returning a new array.
/// Elements are compared using Operators.compare.</summary>
///
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
/// For a stable sort, consider using Seq.sort.</remarks>
/// <param name="projection">The function to transform array elements into the type that is compared.</param>
/// <param name="array">The input array.</param>
/// <returns>The sorted array.</returns>
[<CompiledName("SortBy")>]
val sortBy: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : comparison
/// <summary>Sorts the elements of an array, using the given comparison function as the order, returning a new array.</summary>
///
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
/// For a stable sort, consider using Seq.sort.</remarks>
/// <param name="comparer">The function to compare pairs of array elements.</param>
/// <param name="array">The input array.</param>
/// <returns>The sorted array.</returns>
[<CompiledName("SortWith")>]
val sortWith: comparer:('T -> 'T -> int) -> array:'T[] -> 'T[]
/// <summary>Sorts the elements of an array by mutating the array in-place, using the given projection for the keys.
/// Elements are compared using Operators.compare.</summary>
///
/// <remarks>This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved.
/// For a stable sort, consider using Seq.sort.</remarks>
/// <param name="projection">The function to transform array elements into the type that is compared.</param>
/// <param name="array">The input array.</param>
[<CompiledName("SortInPlaceBy")>]
val sortInPlaceBy: projection:('T -> 'Key) -> array:'T[] -> unit when 'Key : comparison
/// <summary>Sorts the elements of an array by mutating the array in-place, using the given comparison function as the order.</summary>
/// <param name="comparer">The function to compare pairs of array elements.</param>
/// <param name="array">The input array.</param>
[<CompiledName("SortInPlaceWith")>]
val sortInPlaceWith: comparer:('T -> 'T -> int) -> array:'T[] -> unit
/// <summary>Sorts the elements of an array by mutating the array in-place, using the given comparison function.
/// Elements are compared using Operators.compare.</summary>
/// <param name="array">The input array.</param>
[<CompiledName("SortInPlace")>]
val sortInPlace: array:'T[] -> unit when 'T : comparison
/// <summary>Returns the sum of the elements in the array.</summary>
/// <param name="array">The input array.</param>
/// <returns>The resulting sum.</returns>
[<CompiledName("Sum")>]
val inline sum : array: ^T[] -> ^T
when ^T : (static member ( + ) : ^T * ^T -> ^T)
and ^T : (static member Zero : ^T)
/// <summary>Returns the sum of the results generated by applying the function to each element of the array.</summary>
/// <param name="projection">The function to transform the array elements into the type to be summed.</param>
/// <param name="array">The input array.</param>
/// <returns>The resulting sum.</returns>
[<CompiledName("SumBy")>]
val inline sumBy : projection:('T -> ^U) -> array:'T[] -> ^U
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member Zero : ^U)
/// <summary>Builds a list from the given array.</summary>
/// <param name="array">The input array.</param>
/// <returns>The list of array elements.</returns>
[<CompiledName("ToList")>]
val toList: array:'T[] -> 'T list
/// <summary>Views the given array as a sequence.</summary>
/// <param name="array">The input array.</param>
/// <returns>The sequence of array elements.</returns>
[<CompiledName("ToSeq")>]
val toSeq: array:'T[] -> seq<'T>
/// <summary>Returns the first element for which the given function returns <c>true</c>.
/// Return <c>None</c> if no such element exists.</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>The first element that satisfies the predicate, or None.</returns>
[<CompiledName("TryFind")>]
val tryFind: predicate:('T -> bool) -> array:'T[] -> 'T option
/// <summary>Returns the index of the first element in the array
/// that satisfies the given predicate.</summary>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>The index of the first element that satisfies the predicate, or None.</returns>
[<CompiledName("TryFindIndex")>]
val tryFindIndex : predicate:('T -> bool) -> array:'T[] -> int option
/// <summary>Splits an array of pairs into two arrays.</summary>
/// <param name="array">The input array.</param>
/// <returns>The two arrays.</returns>
[<CompiledName("Unzip")>]
val unzip: array:('T1 * 'T2)[] -> ('T1[] * 'T2[])
/// <summary>Splits an array of triples into three arrays.</summary>
/// <param name="array">The input array.</param>
/// <returns>The tuple of three arrays.</returns>
[<CompiledName("Unzip3")>]
val unzip3: array:('T1 * 'T2 * 'T3)[] -> ('T1[] * 'T2[] * 'T3[])
/// <summary>Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The array of tupled elements.</returns>
[<CompiledName("Zip")>]
val zip: array1:'T1[] -> array2:'T2[] -> ('T1 * 'T2)[]
/// <summary>Combines three arrays into an array of pairs. The three arrays must have equal lengths, otherwise an <c>ArgumentException</c> is
/// raised.</summary>
/// <param name="array1">The first input array.</param>
/// <param name="array2">The second input array.</param>
/// <param name="array3">The third input array.</param>
/// <exception cref="System.ArgumentException">Thrown when the input arrays differ in length.</exception>
/// <returns>The array of tupled elements.</returns>
[<CompiledName("Zip3")>]
val zip3: array1:'T1[] -> array2:'T2[] -> array3:'T3[] -> ('T1 * 'T2 * 'T3)[]
#if FX_NO_TPL_PARALLEL
#else
/// <summary>Provides parallel operations on arrays </summary>
module Parallel =
/// <summary>Apply the given function to each element of the array. Return
/// the array comprised of the results "x" for each element where
/// the function returns Some(x).</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="chooser">The function to generate options from the elements.</param>
/// <param name="array">The input array.</param>
/// <returns>'U[]</returns>
[<CompiledName("Choose")>]
val choose: chooser:('T -> 'U option) -> array:'T[] -> 'U[]
/// <summary>For each element of the array, apply the given function. Concatenate all the results and return the combined array.</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="mapping"></param>
/// <param name="array">The input array.</param>
/// <returns>'U[]</returns>
[<CompiledName("Collect")>]
val collect : mapping:('T -> 'U[]) -> array:'T[] -> 'U[]
/// <summary>Build a new array whose elements are the results of applying the given function
/// to each of the elements of the array.</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="mapping"></param>
/// <param name="array">The input array.</param>
/// <returns>'U[]</returns>
[<CompiledName("Map")>]
val map : mapping:('T -> 'U) -> array:'T[] -> 'U[]
/// <summary>Build a new array whose elements are the results of applying the given function
/// to each of the elements of the array. The integer index passed to the
/// function indicates the index of element being transformed.</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="mapping"></param>
/// <param name="array">The input array.</param>
/// <returns>'U[]</returns>
[<CompiledName("MapIndexed")>]
val mapi: mapping:(int -> 'T -> 'U) -> array:'T[] -> 'U[]
/// <summary>Apply the given function to each element of the array. </summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="action"></param>
/// <param name="array">The input array.</param>
[<CompiledName("Iterate")>]
val iter : action:('T -> unit) -> array:'T[] -> unit
/// <summary>Apply the given function to each element of the array. The integer passed to the
/// function indicates the index of element.</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to elements of the input array is not specified.</remarks>
/// <param name="action"></param>
/// <param name="array">The input array.</param>
[<CompiledName("IterateIndexed")>]
val iteri: action:(int -> 'T -> unit) -> array:'T[] -> unit
/// <summary>Create an array given the dimension and a generator function to compute the elements.</summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to indicies is not specified.</remarks>
/// <param name="count"></param>
/// <param name="initializer"></param>
/// <returns>'T[]</returns>
[<CompiledName("Initialize")>]
val init : count:int -> initializer:(int -> 'T) -> 'T[]
/// <summary>Split the collection into two collections, containing the
/// elements for which the given predicate returns "true" and "false"
/// respectively </summary>
///
/// <remarks>Performs the operation in parallel using System.Threading.Parallel.For.
/// The order in which the given function is applied to indicies is not specified.</remarks>
/// <param name="predicate">The function to test the input elements.</param>
/// <param name="array">The input array.</param>
/// <returns>'T[] * 'T[]</returns>
[<CompiledName("Partition")>]
val partition : predicate:('T -> bool) -> array:'T[] -> 'T[] * 'T[]
#endif