-
Notifications
You must be signed in to change notification settings - Fork 104
/
index.html
7274 lines (5592 loc) · 160 KB
/
index.html
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
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Moses documentation</title>
<link rel="stylesheet" href="ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Moses</h1>
<h2>Contents</h2>
<ul>
<li><a href="#Operator_functions">Operator functions </a></li>
<li><a href="#Table_functions">Table functions </a></li>
<li><a href="#Array_functions">Array functions </a></li>
<li><a href="#Utility_functions">Utility functions </a></li>
<li><a href="#Object_functions">Object functions </a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>moses</strong></li>
</ul>
<h2>Manual</h2>
<ul class="nowrap">
<li><a href="manual/tutorial.md.html">tutorial</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>moses</code></h1>
<p>Utility-belt library for functional programming in Lua (<a href="http://github.com/Yonaba/Moses">source</a>)</p>
<p>
</p>
<h3>Info:</h3>
<ul>
<li><strong>Copyright</strong>: 2012-2018</li>
<li><strong>Release</strong>: 2.1.0</li>
<li><strong>License</strong>: <a href="http://www.opensource.org/licenses/mit-license.php">MIT</a></li>
<li><strong>Author</strong>: <a href="http://github.com/Yonaba">Roland Yonaba</a></li>
</ul>
<h2><a href="#Operator_functions">Operator functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#operator.add">operator.add (a, b)</a></td>
<td class="summary">Returns a + b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.concat">operator.concat (a, b)</a></td>
<td class="summary">Returns concatenation of a and b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.div">operator.div (a, b)</a></td>
<td class="summary">Returns a / b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.eq">operator.eq (a, b)</a></td>
<td class="summary">Checks if a equals b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.exp">operator.exp (a, b)</a></td>
<td class="summary">Returns a ^ b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.floordiv">operator.floordiv (a, b)</a></td>
<td class="summary">Performs floor division (//) between <code>a</code> and <code>b</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.ge">operator.ge (a, b)</a></td>
<td class="summary">Checks if a is greater or equal to b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.gt">operator.gt (a, b)</a></td>
<td class="summary">Checks if a is strictly greater than b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.intdiv">operator.intdiv (a, b)</a></td>
<td class="summary">Performs integer division between <code>a</code> and <code>b</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.land">operator.land (a, b)</a></td>
<td class="summary">Returns logical a and b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.le">operator.le (a, b)</a></td>
<td class="summary">Checks if a is less or equal to b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.length">operator.length (a)</a></td>
<td class="summary">Returns the length of a.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.lnot">operator.lnot (a)</a></td>
<td class="summary">Returns logical not a.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.lor">operator.lor (a, b)</a></td>
<td class="summary">Returns logical a or b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.lt">operator.lt (a, b)</a></td>
<td class="summary">Checks if a is strictly less than b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.mod">operator.mod (a, b)</a></td>
<td class="summary">Returns a % b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.mul">operator.mul (a, b)</a></td>
<td class="summary">Returns a * b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.neq">operator.neq (a, b)</a></td>
<td class="summary">Checks if a not equals b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.sub">operator.sub (a, b)</a></td>
<td class="summary">Returns a - b.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#operator.unm">operator.unm (a)</a></td>
<td class="summary">Returns -a.</td>
</tr>
</table>
<h2><a href="#Table_functions">Table functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#adjust">adjust (t, key, f)</a></td>
<td class="summary">Adjusts the value at a given key using a function or a value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#all">all (t, f)</a></td>
<td class="summary">Checks if all values in a table are passing an iterator test.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#allEqual">allEqual (t[, comp])</a></td>
<td class="summary">Checks if all values in a collection are equal.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#at">at (t, ...)</a></td>
<td class="summary">Collects values at given keys and return them wrapped in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#best">best (t, f)</a></td>
<td class="summary">Returns the best value passing a selector function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear (t)</a></td>
<td class="summary">Clears a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#containsKeys">containsKeys (t, other)</a></td>
<td class="summary">Checks if all the keys of <code>other</code> table exists in table <code>t</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#count">count (t[, val])</a></td>
<td class="summary">Counts occurrences of a given value in a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#countBy">countBy (t, iter)</a></td>
<td class="summary">Groups values in a collection and counts them.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#countf">countf (t, f)</a></td>
<td class="summary">Counts the number of values passing a predicate test.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cycle">cycle (t[, n])</a></td>
<td class="summary">Loops <code>n</code> times through a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#detect">detect (t, value)</a></td>
<td class="summary">Performs a linear search for a value in a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#each">each (t, f)</a></td>
<td class="summary">Iterates on key-value pairs, calling <code>f (v, k)</code> at every step.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#eachi">eachi (t, f)</a></td>
<td class="summary">Iterates on integer key-value pairs, calling <code>f(v, k)</code> every step.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#findWhere">findWhere (t, props)</a></td>
<td class="summary">Returns the first value having specified keys <code>props</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#groupBy">groupBy (t, iter)</a></td>
<td class="summary">Splits a table into subsets groups.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#include">include (t, value)</a></td>
<td class="summary">Performs a linear search for a value in a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#invoke">invoke (t, method)</a></td>
<td class="summary">Invokes a method on each value in a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#map">map (t, f)</a></td>
<td class="summary">Maps <code>f (v, k)</code> on value-key pairs, collects and returns the results.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#mapReduce">mapReduce (t, f[, state])</a></td>
<td class="summary">Reduces a table while saving intermediate states.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#mapReduceRight">mapReduceRight (t, f[, state])</a></td>
<td class="summary">Reduces a table while saving intermediate states.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#mapi">mapi (t, f)</a></td>
<td class="summary">Maps <code>f (v, k)</code> on value-key pairs, collects and returns the results.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#max">max (t[, transform])</a></td>
<td class="summary">Returns the max value in a collection.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#min">min (t[, transform])</a></td>
<td class="summary">Returns the min value in a collection.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pluck">pluck (t, key)</a></td>
<td class="summary">Extracts values in a table having a given key.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reduce">reduce (t, f[, state])</a></td>
<td class="summary">Reduces a table, left-to-right.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reduceBy">reduceBy (t, f, pred[, state[, ...]])</a></td>
<td class="summary">Reduces values in a table passing a given predicate.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reduceRight">reduceRight (t, f[, state])</a></td>
<td class="summary">Reduces a table, right-to-left.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reject">reject (t, f)</a></td>
<td class="summary">Clones a table while dropping values passing an iterator test.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#same">same (a, b)</a></td>
<td class="summary">Checks if two tables are the same.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sameKeys">sameKeys (tA, tB)</a></td>
<td class="summary">Checks if both given tables have the same keys.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#select">select (t, f)</a></td>
<td class="summary">Selects and returns values passing an iterator test.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#size">size ([...])</a></td>
<td class="summary">Counts the number of values in a collection.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sort">sort (t[, comp])</a></td>
<td class="summary">Sorts a table, in-place.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sortBy">sortBy (t[, transform[, comp]])</a></td>
<td class="summary">Sorts a table in-place using a transform.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sortedk">sortedk (t[, comp])</a></td>
<td class="summary">Iterates on values with respect to key order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sortedv">sortedv (t[, comp])</a></td>
<td class="summary">Iterates on values with respect to values order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#where">where (t, props)</a></td>
<td class="summary">Returns all values having specified keys <code>props</code>.</td>
</tr>
</table>
<h2><a href="#Array_functions">Array functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#addTop">addTop (array, ...)</a></td>
<td class="summary">Adds all passed-in values at the top of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#aperture">aperture (array[, n])</a></td>
<td class="summary">Iterator returning sliding partitions of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#append">append (array, other)</a></td>
<td class="summary">Clones array and appends values from another array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#chunk">chunk (array, f)</a></td>
<td class="summary">Chunks together consecutive values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#compact">compact (array)</a></td>
<td class="summary">Returns all truthy values (removes <code>falses</code> and <code>nils</code>).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#concat">concat (array[, sep[, i[, j]]])</a></td>
<td class="summary">Concatenates values in a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#difference">difference (array, another)</a></td>
<td class="summary">Returns values from an array not present in all passed-in args.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#disjoint">disjoint (...)</a></td>
<td class="summary">Checks if all passed in arrays are disjunct.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dropWhile">dropWhile (array, f)</a></td>
<td class="summary">Collects values from a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#duplicates">duplicates (array)</a></td>
<td class="summary">Returns an array list of all duplicates in array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#fill">fill (array, value[, i[, j]])</a></td>
<td class="summary">Replaces elements in a given array with a given value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#find">find (array, value[, from])</a></td>
<td class="summary">Looks for the first occurrence of a given value in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#findIndex">findIndex (array, pred)</a></td>
<td class="summary">Returns the first index at which a predicate returns true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#findLastIndex">findLastIndex (array, pred)</a></td>
<td class="summary">Returns the last index at which a predicate returns true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#first">first (array[, n])</a></td>
<td class="summary">Returns the first N values in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#flatten">flatten (array[, shallow])</a></td>
<td class="summary">Flattens a nested array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#indexOf">indexOf (array, value)</a></td>
<td class="summary">Returns the index of the first occurrence of value in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#initial">initial (array[, n])</a></td>
<td class="summary">Returns all values in an array excluding the last N values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#interleave">interleave (...)</a></td>
<td class="summary">Interleaves arrays.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#interpose">interpose (array, value)</a></td>
<td class="summary">Interposes value in-between consecutive pair of values in array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#intersection">intersection (...)</a></td>
<td class="summary">Returns the intersection of all passed-in arrays.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isunique">isunique (array)</a></td>
<td class="summary">Checks if a given array contains distinct values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last">last (array[, n])</a></td>
<td class="summary">Returns the last N values in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#lastIndexOf">lastIndexOf (array, value)</a></td>
<td class="summary">Returns the index of the last occurrence of value in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#mean">mean (array)</a></td>
<td class="summary">Returns the mean of an array of numbers.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#median">median (array)</a></td>
<td class="summary">Returns the median of an array of numbers.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nsorted">nsorted (array[, n[, comp]])</a></td>
<td class="summary">Returns the n-top values satisfying a predicate.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nth">nth (array, index)</a></td>
<td class="summary">Returns the value at a given index.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ones">ones (n)</a></td>
<td class="summary">Returns an array of <code>n</code> 1's.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#overlapping">overlapping (array[, n[, pads]])</a></td>
<td class="summary">Iterator returning overlapping partitions of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pack">pack (...)</a></td>
<td class="summary">Converts a list of arguments to an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pairwise">pairwise (array)</a></td>
<td class="summary">Iterator returning sliding pairs of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#partition">partition (array[, n[, pads]])</a></td>
<td class="summary">Iterator returning partitions of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#permutation">permutation (array)</a></td>
<td class="summary">Iterator returning the permutations of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#powerset">powerset (array)</a></td>
<td class="summary">Returns the powerset of array values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#prepend">prepend (array, ...)</a></td>
<td class="summary">Adds all passed-in values at the top of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#product">product (array)</a></td>
<td class="summary">Returns the product of array values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pull">pull (array, ...)</a></td>
<td class="summary">Removes all provided values in a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#push">push (array, ...)</a></td>
<td class="summary">Pushes all passed-in values at the end of an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#range">range ([from[, to[, step]]])</a></td>
<td class="summary">Produces a flexible list of numbers.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#removeRange">removeRange (array[, start[, finish]])</a></td>
<td class="summary">Removes values at an index within the range <code>[start, finish]</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#rep">rep (value, n)</a></td>
<td class="summary">Creates an array list of <code>n</code> values, repeated.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#rest">rest (array[, index])</a></td>
<td class="summary">Returns all values after index.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reverse">reverse (array)</a></td>
<td class="summary">Returns an array where values are in reverse order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sample">sample (array[, n[, seed]])</a></td>
<td class="summary">Samples <code>n</code> random values from an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sampleProb">sampleProb (array, prob[, seed])</a></td>
<td class="summary">Return elements from a sequence with a given probability.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#selectWhile">selectWhile (array, f)</a></td>
<td class="summary">Collects values from a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#shift">shift (array[, n])</a></td>
<td class="summary">Removes and returns the values at the top of a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#shuffle">shuffle (array[, seed])</a></td>
<td class="summary">Returns a shuffled copy of a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#slice">slice (array[, start[, finish]])</a></td>
<td class="summary">Slices values indexed within <code>[start, finish]</code> range.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sortedIndex">sortedIndex (array, the[, comp[, sort]])</a></td>
<td class="summary">Returns the index at which a value should be inserted.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#sum">sum (array)</a></td>
<td class="summary">Returns the sum of array values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#symmetricDifference">symmetricDifference (array, array2)</a></td>
<td class="summary">Performs a symmetric difference.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#union">union (...)</a></td>
<td class="summary">Returns the duplicate-free union of all passed in arrays.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unique">unique (array)</a></td>
<td class="summary">Produces a duplicate-free version of a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unshift">unshift (array[, n])</a></td>
<td class="summary">Removes and returns the values at the end of a given array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#vector">vector (value, n)</a></td>
<td class="summary">Returns an array of <code>n</code> times a given value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#xpairs">xpairs (valua, array)</a></td>
<td class="summary">Creates pairs from value and array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#xpairsRight">xpairsRight (valua, array)</a></td>
<td class="summary">Creates pairs from value and array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#xprod">xprod (array, array2)</a></td>
<td class="summary">Returns all possible pairs built from given arrays.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#zeros">zeros (n)</a></td>
<td class="summary">Returns an array of <code>n</code> zeros.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#zip">zip (...)</a></td>
<td class="summary">Merges values of each of the passed-in arrays in subsets.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#zipWith">zipWith (f, ...)</a></td>
<td class="summary">Merges values using a given function.</td>
</tr>
</table>
<h2><a href="#Utility_functions">Utility functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#after">after (f, count)</a></td>
<td class="summary">Returns a version of <code>f</code> that runs on the <code>count-th</code> call.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#applySpec">applySpec (specs)</a></td>
<td class="summary">Returns a function which applies <code>specs</code> on args.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ary">ary (f[, n])</a></td>
<td class="summary">Returns a function which accepts up to <code>n</code> args.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#before">before (f, count)</a></td>
<td class="summary">Returns a version of <code>f</code> that will run no more than <em>count</em> times.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bind">bind (f, v)</a></td>
<td class="summary">Binds <code>v</code> to be the first argument to <code>f</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bind2">bind2 (f, v)</a></td>
<td class="summary">Binds <code>v</code> to be the second argument to <code>f</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bindall">bindall (obj, ...)</a></td>
<td class="summary">Binds methods to object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bindn">bindn (f, ...)</a></td>
<td class="summary">Binds <code>...</code> to be the N-first arguments to function <code>f</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#both">both (...)</a></td>
<td class="summary">Returns a validation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#call">call (f[, ...])</a></td>
<td class="summary">Calls <code>f</code> with the supplied arguments.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#castArray">castArray (value)</a></td>
<td class="summary">Casts value as an array if it is not one.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#complement">complement (f)</a></td>
<td class="summary">Returns the logical complement of a given function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#compose">compose (...)</a></td>
<td class="summary">Composes functions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cond">cond (conds)</a></td>
<td class="summary">Returns a function which iterate over a set of conditions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#constant">constant (value)</a></td>
<td class="summary">Creates a constant function which returns the same output on every call.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#converge">converge (f, g, h)</a></td>
<td class="summary">Converges two functions into one.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#curry">curry (f[, n_args])</a></td>
<td class="summary">Curries a function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dispatch">dispatch (...)</a></td>
<td class="summary">Returns a dispatching function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#either">either (...)</a></td>
<td class="summary">Returns a validation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#flip">flip (f)</a></td>
<td class="summary">Creates a function of <code>f</code> with arguments flipped in reverse order.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#identity">identity (value)</a></td>
<td class="summary">Returns the passed-in value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#iterator">iterator (f, value[, n])</a></td>
<td class="summary">Produces an iterator which repeatedly apply a function <code>f</code> onto an input.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#iterlen">iterlen (...)</a></td>
<td class="summary">Returns the length of an iterator.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juxtapose">juxtapose (value, ...)</a></td>
<td class="summary">Calls a sequence of passed-in functions with the same argument.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#memoize">memoize (f)</a></td>
<td class="summary">Memoizes a given function by caching the computed result.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#neither">neither (...)</a></td>
<td class="summary">Returns a validation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#noarg">noarg (f)</a></td>
<td class="summary">Returns a function with an arity of 0.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#noop">noop ()</a></td>
<td class="summary">The no operation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nthArg">nthArg (n)</a></td>
<td class="summary">Returns a function that gets the nth argument.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#once">once (f)</a></td>
<td class="summary">Returns a version of <code>f</code> that runs only once.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#over">over (...)</a></td>
<td class="summary">Creates a function that runs transforms on all arguments it receives.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#overArgs">overArgs (f, ...)</a></td>
<td class="summary">Creates a function that invokes <code>f</code> with its arguments transformed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#overEvery">overEvery (...)</a></td>
<td class="summary">Creates a validation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#overSome">overSome (...)</a></td>
<td class="summary">Creates a validation function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#partial">partial (f, ...)</a></td>
<td class="summary">Partially apply a function by filling in any number of its arguments.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#partialRight">partialRight (f, ...)</a></td>
<td class="summary">Similar to <a href="index.html#partial">partial</a>, but from the right.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pipe">pipe (value, ...)</a></td>
<td class="summary">Pipes a value through a series of functions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#rearg">rearg (f, indexes)</a></td>
<td class="summary">Returns a function which runs with arguments rearranged.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#skip">skip (iter[, n])</a></td>
<td class="summary">Consumes the first <code>n</code> values of a iterator then returns it.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#tabulate">tabulate (...)</a></td>
<td class="summary">Iterates over an iterator and returns its values in an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#thread">thread (value, ...)</a></td>
<td class="summary">Threads <a href="index.html#obj:value">value</a> through a series of functions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#threadRight">threadRight (value, ...)</a></td>
<td class="summary">Threads <a href="index.html#obj:value">value</a> through a series of functions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#time">time (f[, ...])</a></td>
<td class="summary">Returns the execution time of <code>f (...)</code> and its returned values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#times">times (iter[, n])</a></td>
<td class="summary">Runs <code>iter</code> function <code>n</code> times.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unary">unary (f)</a></td>
<td class="summary">Returns a function which accepts up to one arg.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unfold">unfold (f, seed)</a></td>
<td class="summary">Builds a list from a seed value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#uniqueId">uniqueId ([template])</a></td>
<td class="summary">Generates an unique ID for the current session.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#wrap">wrap (f, wrapper)</a></td>
<td class="summary">Wraps <code>f</code> inside of the <code>wrapper</code> function.</td>
</tr>
</table>
<h2><a href="#Object_functions">Object functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#chain">chain (value)</a></td>
<td class="summary">Returns a wrapped object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clone">clone (obj[, shallow])</a></td>
<td class="summary">Clones a given object properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#extend">extend (destObj, ...)</a></td>
<td class="summary">Extends an object properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#flattenPath">flattenPath (obj, ...)</a></td>
<td class="summary">Flattens object under property path onto provided object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#functions">functions ([obj])</a></td>
<td class="summary">Returns a sorted list of all methods names found in an object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#has">has (obj, key)</a></td>
<td class="summary">Checks if a given object implements a property.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#import">import ([context[, noConflict]])</a></td>
<td class="summary">Imports all library functions into a context.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#invert">invert (obj)</a></td>
<td class="summary">Swaps keys with values.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isArray">isArray (obj)</a></td>
<td class="summary">Checks if the given argument is an array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isBoolean">isBoolean (obj)</a></td>
<td class="summary">Checks if the given argument is a boolean.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isCallable">isCallable (obj)</a></td>
<td class="summary">Checks if the given argument is callable.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isEmpty">isEmpty ([obj])</a></td>
<td class="summary">Checks if the given pbject is empty.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isEqual">isEqual (objA, objB[, useMt])</a></td>
<td class="summary">Performs a deep comparison test between two objects.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isFinite">isFinite (obj)</a></td>
<td class="summary">Checks if the given argument is a finite number.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isFunction">isFunction (obj)</a></td>
<td class="summary">Checks if the given argument is a function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isInteger">isInteger (obj)</a></td>
<td class="summary">Checks if the given argument is an integer.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isIterable">isIterable (obj)</a></td>
<td class="summary">Checks if the given object is iterable with <a href="https://www.lua.org/manual/5.1/manual.html#pdf-pairs">pairs</a> (or <a href="https://www.lua.org/manual/5.1/manual.html#pdf-ipairs">ipairs</a>).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isNaN">isNaN (obj)</a></td>
<td class="summary">Checks if the given argument is NaN (see <a href="http://en.wikipedia.org/wiki/NaN">Not-A-Number</a>).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isNil">isNil (obj)</a></td>
<td class="summary">Checks if the given argument is nil.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isNumber">isNumber (obj)</a></td>
<td class="summary">Checks if the given argument is a number.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isString">isString (obj)</a></td>
<td class="summary">Checks if the given argument is a string.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isTable">isTable (t)</a></td>
<td class="summary">Checks if the given arg is a table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#keys">keys (obj)</a></td>
<td class="summary">Returns the keys of the object properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#kvpairs">kvpairs (obj)</a></td>
<td class="summary">Converts key-value pairs to an array-list of <code>[k, v]</code> pairs.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#obj:value">obj:value ()</a></td>
<td class="summary">Extracts the value of a wrapped object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#omit">omit (obj, ...)</a></td>
<td class="summary">Returns an object copy without black-listed properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#path">path (obj, ...)</a></td>
<td class="summary">Returns the value at a given path in an object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pick">pick (obj, ...)</a></td>
<td class="summary">Returns an object copy having white-listed properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#property">property (key)</a></td>
<td class="summary">Returns a function that will return the key property of any passed-in object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#propertyOf">propertyOf (obj)</a></td>
<td class="summary">Returns a function which will return the value of an object property.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#result">result (obj, method)</a></td>
<td class="summary">Invokes an object method.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#spreadPath">spreadPath (obj, ...)</a></td>
<td class="summary">Spreads object under property path onto provided object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#tap">tap (obj, f)</a></td>
<td class="summary">Invokes interceptor with the object, and then returns object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#template">template (obj[, template])</a></td>
<td class="summary">Applies a template to an object, preserving non-nil properties.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#toBoolean">toBoolean (value)</a></td>
<td class="summary">Converts any given value to a boolean</td>
</tr>
<tr>
<td class="name" nowrap><a href="#toObj">toObj (kvpairs)</a></td>
<td class="summary">Converts an array list of <code>[k,v]</code> pairs to an object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#type">type (obj)</a></td>
<td class="summary">Extends Lua's <a href="index.html#type">type</a> function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#values">values (obj)</a></td>
<td class="summary">Returns the values of the object properties.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Operator_functions"></a>Operator functions </h2>
<dl class="function">
<dt>
<a name = "operator.add"></a>
<strong>operator.add (a, b)</strong>
</dt>
<dd>
Returns a + b. <em>Aliased as <code>op.add</code></em>.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">a</span>
a value
</li>
<li><span class="parameter">b</span>
a value
</li>
</ul>
<h3>Returns:</h3>
<ol>
a + b
</ol>
</dd>
<dt>
<a name = "operator.concat"></a>
<strong>operator.concat (a, b)</strong>
</dt>
<dd>
Returns concatenation of a and b. <em>Aliased as <code>op.concat</code></em>.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">a</span>
a value
</li>
<li><span class="parameter">b</span>
a value
</li>
</ul>
<h3>Returns:</h3>
<ol>
a .. b
</ol>
</dd>
<dt>
<a name = "operator.div"></a>
<strong>operator.div (a, b)</strong>
</dt>
<dd>
Returns a / b. <em>Aliased as <code>op.div</code></em>.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">a</span>
a value
</li>
<li><span class="parameter">b</span>
a value
</li>
</ul>
<h3>Returns:</h3>
<ol>
a / b
</ol>