Caml1999I022  V    H  >ݠ/List-Suspenders!t@  , !a  @A@AI$list@@@  Y@@&_none_A@ A'res.doc	0 `'a t` is compatible with built-in `list` type @@@@@@@@@&length@@+!a  @@  A#int@@@  @  @&#)	b
Returns the length of a list.

## Examples

```rescript
Belt.List.length(list{1, 2, 3}) // 3
```
@1@@1@@$size@@!!a  @@   @@  @  @DAG8 See `Belt.List.length` @O@@O@@$head@@?!a  @@  񰳐J&option@@@  @  @ebh	
Returns `Some(value)` where `value` is the first element in the list, or
`None` if `someList` is an empty list.

## Examples

```rescript
Belt.List.head(list{}) // None
Belt.List.head(list{1, 2, 3}) // Some(1)
```
@p@@p@@'headExn@@`!a  @@  @  @|	
Same as `Belt.List.head` but raises an exception if `someList` is empty. Use
with care.

## Examples

```rescript
Belt.List.headExn(list{1, 2, 3}) // 1

Belt.List.headExn(list{}) // Raises an Error
```
@@@@@$tail@@z!a  @@  鰳;@@  @@  @  @	
Returns `None` if `someList` is empty, otherwise it returns `Some(tail)`
where `tail` is everything except the first element of `someList`.

## Examples

```rescript
Belt.List.tail(list{1, 2, 3}) // Some(list{2, 3})

Belt.List.tail(list{}) // None
```
@@@@@'tailExn@@!a  @@  尳@@  @  @Ð	
Same as `Belt.List.tail` but raises an exception if `someList` is empty. Use
with care.

## Examples

```rescript
Belt.List.tailExn(list{1, 2, 3}) // list{2, 3}

Belt.List.tailExn(list{}) // Raises an Error
```
@@@@@#add@@!a  @@  @Š
@@  @  @  @ࠠ㐠	
Adds `value` to the beginning of `someList`.

## Examples

```rescript
Belt.List.add(list{2, 3}, 1) // list{1, 2, 3}

Belt.List.add(list{"World", "!"}, "Hello") // list{"Hello", "World", "!"}
```
@@@@@#get@@۠!a  @@  ڰ@@@  ۰@@  @  @  @	
Return the nth element in `someList`, or `None` if `index` is larger than the
length.

## Examples

```rescript
let abc = list{"A", "B", "C"}

abc->Belt.List.get(1) // Some("B")

abc->Belt.List.get(4) // None
```
@@@@@&getExn@@ !a  @@  հ@@@  @  @  @%"(	
Same as `Belt.List.get` but raises an exception if `index` is larger than the
length. Use with care.

## Examples

```rescript
let abc = list{"A", "B", "C"}

abc->Belt.List.getExn(1) // "B"

abc->Belt.List.getExn(4) // Raises an Error
```
@0@@0@@$make@@@@  а@!a  Ѱ*@@  @  @  @EBH	
Returns a list of length `numItems` with each element filled with value `v`. Returns an empty list if `numItems` is negative.

## Examples

```rescript
Belt.List.make(3, 1) // list{1, 1, 1}
```
@P@@P@@'makeByU@@7@@  ư@U)function$@@E@@  ɰ!a  @  ʠࠠ*Has_arity1@@@  @A@@  @@  ˰`@@  @  @  @{x~	( Uncurried version of [makeBy](#makeBy) @@@@@&makeBy@@m@@  @@u@@  !a  @  @@  @  @  @
  	
Return a list of length `numItems` with element `i` initialized with `f(i)`.
Returns an empty list if `numItems` is negative.

## Examples

```rescript
Belt.List.makeBy(5, i => i) // list{0, 1, 2, 3, 4}

Belt.List.makeBy(5, i => i * i) // list{0, 1, 4, 9, 16}
```
@@@@@'shuffle@@!a  @@  @@  @  @	u
Returns a new list in random order.

## Examples

```rescript
Belt.List.shuffle(list{1, 2, 3}) // list{2, 1, 3}
```
@@@@@$drop@@!a  @@  @@@  ̠@@  @@  @  @  @蠠될
  
Return a new list, dropping the first `n` elements. Returns `None` if `someList` has fewer than `n` elements.

## Examples

```rescript
list{1, 2, 3}->Belt.List.drop(2) // Some(list{3})

list{1, 2, 3}->Belt.List.drop(3) // Some(list{})

list{1, 2, 3}->Belt.List.drop(4) // None
```
@@@@@$take@@㠰!a  @@  @@@  @@  @@  @  @  @
  "
Returns a list with the first `n` elements from `someList`, or `None` if `someList` has fewer than `n` elements.

## Examples

```rescript
list{1, 2, 3}->Belt.List.take(1) // Some(list{1})

list{1, 2, 3}->Belt.List.take(2) // Some(list{1, 2})

list{1, 2, 3}->Belt.List.take(4) // None
```
@@@@@'splitAt@@!a  @@  @@@  Ӡ@@@  F@@  @  @@  @  @  @DAG
  -
Split the list `someList` at `index`. Returns `None` when the length of `someList` is less than `index`.

## Examples

```rescript
list{"Hello", "World"}->Belt.List.splitAt(1) // Some((list{"Hello"}, list{"World"}))

list{0, 1, 2, 3, 4}->Belt.List.splitAt(2) // Some((list{0, 1}, list{2, 3, 4}))
```
@O@@O@@&concat@@?!a  @@  @I
@@  M@@  @  @  @hek	
Returns the list obtained by adding `secondList` after `firstList`.

## Examples

```rescript
Belt.List.concat(list{1, 2, 3}, list{4, 5}) // list{1, 2, 3, 4, 5}
```
@s@@s@@*concatMany@@H%array@i!a  @@  @@  r	@@  @  @	
Returns the list obtained by concatenating all the lists in array `a`, in
order.

## Examples

```rescript
Belt.List.concatMany([list{1, 2, 3}, list{}, list{3}]) // list{1, 2, 3, 3}
```
@@@@@-reverseConcat@@!a  @@  @
@@  @@  @  @  @	
Equivalent to writing: `concat(reverse(firstList, secondList)`

## Examples

```rescript
Belt.List.reverseConcat(list{1, 2}, list{3, 4}) // list{2, 1, 3, 4}
```
@@@@@'flatten@@!a  @@  @@  	@@  @  @Ӡ֐	
Return the list obtained by concatenating all the lists in list `ls`, in order.

## Examples

```rescript
Belt.List.flatten(list{list{1, 2, 3}, list{}, list{3}}) // list{1, 2, 3, 3}
```
@@@@@$mapU@@Π!a  @@  @@!b  @  ࠠ*Has_arity1@@  @A@@  @@  @@  @  @  @		# Uncurried version of [map](#map). @@@@@#map@@!a ~@@ }@@	!b  @ @@  @  @  @,)/	
Returns a new list with `f` applied to each element of `someList`.

## Examples

```rescript
list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}
```
@7@@7@@#zip@@'!a x@@ u@1!b w@@ v9@ y@@ z@ {@ |@XU[	
Returns a list of pairs from the two lists with the length of the shorter list.

## Examples

```rescript
Belt.List.zip(list{1, 2}, list{3, 4, 5}) // list{(1, 3), (2, 4)}
```
@c@@c@@&zipByU@@S!a k@@ g@]!b l@@ h@!@@!c p@ m@ nࠠ*Has_arity2@@ i@A@@ j@@ o|@@ q@ r@ s@ t@	' Uncurried version of [zipBy](#zipBy). @@@@@%zipBy@@!a ^@@ \@!b _@@ ]@@@!c b@ `@ a@@ c@ d@ e@ f@ɠ̐	
See [Belt.List.zip](#zip)

## Examples

```rescript
Belt.List.zipBy(list{1, 2, 3}, list{4, 5}, (a, b) => 2 * a + b) // list{6, 9}
```
@@@@@-mapWithIndexU@@Ġ!a T@@ P@@@@ S@!b X@ U@ Vࠠ*Has_arity2@@ Q@A@@ R@@ W@@ Y@ Z@ [@	5 Uncurried version of [mapWithIndex](#mapWithIndex). @@@@@,mapWithIndex@@!a I@@ G@@ @@ H@!b L@ J@ K@@ M@ N@ O@.+1
  
Applies `f` to each element of `someList`.
Function `f` takes two arguments: the index starting from 0 and the element from `someList`, in that order.

## Examples

```rescript
list{1, 2, 3}->Belt.List.mapWithIndex((index, x) => index + x) // list{1, 3, 5}
```
@9@@9@@)fromArray@@Ơ!a D@@ C2@@ E@ F@MJP	s
Converts the given array to a list.

## Examples

```rescript
Belt.List.fromArray([1, 2, 3]) // list{1, 2, 3}
```
@X@@X@@'toArray@@H!a @@@ ?	@@ A@ B@lio	r
Converts the given list to an array.

## Examples

```rescript
Belt.List.toArray(list{1, 2, 3}) // [1, 2, 3]
```
@w@@w@@'reverse@@g!a <@@ ;o@@ =@ >@	
Returns a new list whose elements are those of `someList` in reversed order.

## Examples

```rescript
Belt.List.reverse(list{1, 2, 3}) /* list{3, 2, 1} */
```
@@@@@+mapReverseU@@!a 4@@ 1@I@!b 7@ 5ࠠ*Has_arity1C@@ 2@A@@ 3@@ 6@@ 8@ 9@ :@	1 Uncurried version of [mapReverse](#mapReverse). @@@@@*mapReverse@@!a +@@ *@@	!b -@ ,Ƞ@@ .@ /@ 0@㠠搠	
Equivalent to:

```res
map(someList, f)->reverse
```

## Examples

```rescript
list{3, 4, 5}->Belt.List.mapReverse(x => x * x) /* list{25, 16, 9} */
```
@@@@@(forEachU@@ޠ!a #@@  @@!b $@ %ࠠ*Has_arity1@@ !@A@@ "@@ &F$unit@@@ '@ (@ )@	+ Uncurried version of [forEach](#forEach). @#@@#@@'forEach@@!a @@ @@	!b @ (@@ @ @ @>;A
  Z
Call `f` on each element of `someList` from the beginning to end.
`f` returns `unit`, so no new array is created. Use `forEach` when you are primarily concerned with repetitively creating side effects.

## Examples

```rescript
Belt.List.forEach(list{"a", "b", "c"}, x => Js.log("Item: " ++ x))
/*
  prints:
  Item: a
  Item: b
  Item: c
*/
```
@I@@I@@1forEachWithIndexU@@9!a @@ @@@@@ @!b @ @ ࠠ*Has_arity2@@ @A@@ @@ a@@ @ @ @wtz	= Uncurried version of [forEachWithIndex](#forEachWithIndex). @@@@@0forEachWithIndex@@r!a @@ @@u@@ @!b @ @ 	@@ 
@ @ @
  
Call `f` on each element of `someList` from beginning to end.
Function `f` takes two arguments: the index starting from 0 and the element from `someList`. `f` returns `unit`.

## Examples

```rescript
Belt.List.forEachWithIndex(list{"a", "b", "c"}, (index, x) => {
  Js.log("Item " ++ Belt.Int.toString(index) ++ " is " ++ x)
})
/*
  prints:
  Item 0 is a
  Item 1 is b
  Item 2 is cc
*/
```
@@@@@'reduceU@@!a @@ @!b  @h@@@ @ ࠠ*Has_arity2`@@ @A@@ @@ @ @ @ @֠ِ	) Uncurried version of [reduce](#reduce). @@@@@&reduce@@Ѡ!a @@ @!b @@@
@ @ 
@ @ @ @
  
Applies `f` to each element of `someList` from beginning to end. Function `f` has two parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue`. reduce returns the final value of the accumulator.

## Examples

```rescript
list{1, 2, 3, 4}->Belt.List.reduce(0, (a, b) => a + b) /* 10 */

/* same as */

list{1, 2, 3, 4}->Belt.List.reduce(0, (acc, item) => acc + item) /* 10 */
```
@@@@@0reduceWithIndexU@@!a @@ @!b @@@@@@ @ @ @ 렰ࠠ*Has_arity3@@ @A@@ @@ @ @ @ @528	; Uncurried version of [reduceWithIndex](#reduceWithIndex). @@@@@@@/reduceWithIndex@@0!a @@ ڰ@!b @@@@=@@ @ @ @ @ @ @ @a^d
  
Applies `f` to each element of `someList` from beginning to end. Function `f` has three parameters: the item from the list and an “accumulator”, which starts with a value of `initialValue` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.

## Examples

```rescript
list{1, 2, 3, 4}->Belt.List.reduceWithIndex(0, (acc, item, index) => acc + item + index) /* 16 */
```
@l@@l@@.reduceReverseU@@\!a @@ ϰ@!b ְ@&@@@ @ Ԡࠠ*Has_arity2@@ @A@@ @@ @ @ @ @	7 Uncurried version of [reduceReverse](#reduceReverse). @@@@@-reduceReverse@@!a @@ ǰ@!b ˰@@@
@ @ 
@ @ @ @
  
Works like [reduce](#reduce), except that function `f` is applied to each
item of `someList` from the last back to the first.

## Examples

```rescript
list{1, 2, 3, 4}->Belt.List.reduceReverse(0, (a, b) => a + b) /* 10 */

list{1, 2, 3, 4}->Belt.List.reduceReverse(10, (a, b) => a - b) /* 0 */

list{1, 2, 3, 4}->Belt.List.reduceReverse(list{}, Belt.List.add) // list{1, 2, 3, 4}
```
@@@@@,mapReverse2U@@!a @@ @!b @@ @@@!c @ @ ࠠ*Has_arity2@@ @A@@ @@ ޠ@@ @ @ @ @	3 Uncurried version of [mapReverse2](#mapReverse2). @@@@@+mapReverse2@@!a @@ @!b @@ @@@!c @ @ @@ @ @ @ @+(.	
Equivalent to: `zipBy(xs, ys, f)->reverse`

## Examples

```rescript

Belt.List.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) // list{4, 2}
```
@6@@6@@)forEach2U@@&!a @@ @0!b @@ @@@!c @ @ ࠠ*Has_arity2@@ @A@@ @@ T@@ @ @ @ @jgm	- Uncurried version of [forEach2](#forEach2). @u@@u@@(forEach2@@e!a @@ @o!b @@ @@@!c @ @ @@ @ @ @ @	
Stops at the length of the shorter list.

## Examples

```rescript
Belt.List.forEach2(list{"Z", "Y"}, list{"A", "B", "C"}, (x, y) => Js.log2(x, y))

/*
  prints:
  "Z" "A"
  "Y" "B"
*/
```
@@@@@(reduce2U@@!b @@ @!c @@ @!a @k@@@@ @ @ ࠠ*Has_arity3e@@ @A@@ @@ @ @ @ @ @۠ސ	+ Uncurried version of [reduce2](#reduce2). @@@@@'reduce2@@֠!b |@@ z@࠰!c }@@ {@!a @@@@@ ~@ @ @ @ @ @ @

  
Applies `f` to each element of `firstList` and `secondList` from beginning to end. Stops with the shorter list. Function `f` has three parameters: an “accumulator” which starts with a value of `initialValue`, an item from `firstList`, and an item from `secondList`. `reduce2` returns the final value of the accumulator.

## Examples

```rescript
Belt.List.reduce2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) /* 0 + (1 * 1 + 4) + (2 * 2 + 5) */
```
@@@@@/reduceReverse2U@@!a o@@ k@!b p@@ l@!c u@ܠ@@@@ q@ r@ sࠠ*Has_arity3@@ m@A@@ n@@ t@ v@ w@ x@ y@LIO	9 Uncurried version of [reduceReverse2](#reduceReverse2). @W@@W@@.reduceReverse2@@G!a a@@ _@Q!b b@@ `@!c f@@@@@ c@ d@ e@ g@ h@ i@ j@~{
  
Applies `f` to each element of `firstList` and `secondList` from end to
beginning. Stops with the shorter list. Function `f` has three parameters: an
“accumulator” which starts with a value of init, an item from `firstList`,
and an item from `secondList`. `reduce2` returns the final value of the
accumulator.

## Examples

```rescript
Belt.List.reduceReverse2(list{1, 2, 3}, list{4, 5}, 0, (acc, x, y) => acc + x * x + y) /*  + (1 * 1 + 4) + (2 * 2 + 5) */
```
@@@@@&everyU@@y!a X@@ U@=@E$bool@@@ Y@ Zࠠ*Has_arity19@@ V@A@@ W@@ [@@ \@ ]@ ^@	' Uncurried version of [every](#every). @@@@@%every@@!a O@@ N@@	1@@ P@ Q5@@ R@ S@ T@٠ܐ
  6
Returns `true` if all elements satisfy `pred`, where `pred` is a predicate: a function taking an element and returning a bool.

## Examples

```rescript
let isBelow10 = value => value < 10

list{1, 9, 8, 2}->Belt.List.every(isBelow10) /* true */

list{1, 99, 8, 2}->Belt.List.every(isBelow10) /* false */
```
@@@@@%someU@@Ԡ!a G@@ D@@[@@ H@ Iࠠ*Has_arity1@@ E@A@@ F@@ Jh@@ K@ L@ M@					% Uncurried version of [some](#some). @	@@	@@$some@@	!a >@@ =@@	@@ ?@ @@@ A@ B@ C@	2	/	5
  [
Returns `true` if at least _one_ of the elements in `someList` satisfies
`pred`, where `pred` is a predicate: a function taking an element and
returning a bool.

## Examples

```rescript
let isAbove100 = value => value > 100

list{101, 1, 2, 3}->Belt.List.some(isAbove100) /* true */

list{1, 2, 3, 4}->Belt.List.some(isAbove100) /* false */
```
@	=@@	=@@'every2U@@	-!a 3@@ /@	7!b 4@@ 0@@@@@ 5@ 6@ 7ࠠ*Has_arity2@@ 1@A@@ 2@@ 8@@ 9@ :@ ;@ <@	q	n	t	) Uncurried version of [every2](#every2). @	|@@	|@@&every2@@	l!a &@@ $@	v!b '@@ %@@@@@ (@ )@ *@@ +@ ,@ -@ .@			
  
Returns `true` if predicate `pred(a, b)` is `true` for all pairs of elements
up to the shorter length (i.e. `min(length(firstList), length(secondList))`)

## Examples

```rescript
Belt.List.every2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) /* true */

Belt.List.every2(list{}, list{1}, (a, b) => a > b) /* true */

Belt.List.every2(list{2, 3}, list{1}, (a, b) => a > b) /* true */

Belt.List.every2(list{0, 1}, list{5, 0}, (a, b) => a > b) /* false */
```
@	@@	@@&some2U@@	!a @@ @	!b @@ @l@@1@@ @ @ ࠠ*Has_arity2h@@ @A@@ @@ >@@  @ !@ "@ #@	⠠		吠	' Uncurried version of [some2](#some2). @	@@	@@%some2@@	ݠ!a @@ @	砰!b @@ @@@l@@ @ @ p@@ @ @ @ @



  
Returns `true` if predicate `pred(a, b)` is true for any pair of elements up
to the shorter length (i.e. `min(length(firstList), length(secondList))`)

## Examples

```rescript
Belt.List.some2(list{1, 2, 3}, list{0, 1}, (a, b) => a > b) /* true */

Belt.List.some2(list{}, list{1}, (a, b) => a > b) /* false */

Belt.List.some2(list{2, 3}, list{1}, (a, b) => a > b) /* true */

Belt.List.some2(list{0, 1}, list{5, 0}, (a, b) => a > b) /* true */
```
@
@@
@@+cmpByLength@@
!a @@ @

@@ 
@@ @ 	@ 
@
8
5
;
  
Compare two lists solely by length. Returns `-1` if `length(firstList)` is
less than `length(secondList)`, `0` if `length(firstList)` equals
`length(secondList)`, and `1` if `length(firstList)` is greater than
`length(secondList)`.

## Examples

```rescript
Belt.List.cmpByLength(list{1, 2}, list{3, 4, 5, 6}) /* -1 */

Belt.List.cmpByLength(list{1, 2, 3}, list{4, 5, 6}) /* = 0 */

Belt.List.cmpByLength(list{1, 2, 3, 4}, list{5, 6}) /* = 1 */
```
@
C@@
C@@$cmpU@@
3!a @@ @
=
@@ @@@
B@@ @ @ ࠠ*Has_arity2@@ @A@@ @@  
O@@ @ @ @ @
s
p
v	# Uncurried version of [cmp](#cmp). @
~@@
~@@#cmp@@
n!a @@ @
x
@@ @@@
y@@ @ @ 󰳐
}@@ @ @ @ @



  
Compare elements one by one `compareFn(a, b)`. `compareFn` returns a negative number if `a` is "less than" `b`, zero if `a` is "equal to" `b`, a positive number if `a` is "greater than" `b`.

The comparison returns the first non-zero result of `compareFn`, or zero if `compareFn` returns zero for all `a` and `b`.

If all items have compared equal, but `firstList` is exhausted first, return `-1`. (`firstList` is shorter).
If all items have compared equal, but `secondList` is exhausted first, return `1` (`firstList` is longer).

## Examples

```rescript
Belt.List.cmp(list{3}, list{3, 7}, (a, b) => compare(a, b)) /* (-1) */

Belt.List.cmp(list{5, 3}, list{5}, (a, b) => compare(a, b)) /* 1 */

Belt.List.cmp(list{1, 3, 5}, list{1, 4, 2}, (a, b) => compare(a, b)) /* (-1) */

Belt.List.cmp(list{1, 3, 5}, list{1, 2, 3}, (a, b) => compare(a, b)) /* 1 */

Belt.List.cmp(list{1, 3, 5}, list{1, 3, 5}, (a, b) => compare(a, b)) /* 0 */
```

**Please note:** The total ordering of List is different from Array,
for Array, we compare the length first and, only if the lengths are equal, elements one by one.
For lists, we just compare elements one by one.
@
@@
@@#eqU@@
!a @@ @

@@ @	f@@+@@ @ @ 蠰ࠠ*Has_arity2	b@@ @A@@ @@ 鰳8@@ @ @ @ @
ܠ

ߐ	! Uncurried version of [eq](#eq). @
@@
@@"eq@@
נ!a @@ װ@

@@ ذ@@@b@@ @ @ ܰf@@ @ @ @ @

  
Check equality of `firstList` and `secondList` using `eqElem` for equality on
elements, where `eqElem` is a function that returns `true` if items `x` and
`y` meet some criterion for equality, `false` otherwise. eq `false` if length
of `firstList` and `secondList` are not the same.

## Examples

```rescript
Belt.List.eq(list{1, 2, 3}, list{1, 2}, (a, b) => a == b) /* false */

Belt.List.eq(list{1, 2}, list{1, 2}, (a, b) => a == b) /* true */

Belt.List.eq(list{1, 2, 3}, list{(-1), (-2), (-3)}, (a, b) => abs(a) == abs(b)) /* true */
```
@@@@@$hasU@@!a @@ ʰ@!b ΰ@	Ϡ@@@@ @ @ Ѡࠠ*Has_arity2	@@ @A@@ @@ Ұ@@ @ @ @ @EBH	# Uncurried version of [has](#has). @P@@P@@#has@@@!a @@ @!b °@@@
@@ @ @ Ű@@ @ @ @ @spv
  M
Returns `true` if the list contains at least one element for which
`eqFunction(x)` returns true.

## Examples

```rescript
list{1, 2, 3}->Belt.List.has(2, (a, b) => a == b) /* true */

list{1, 2, 3}->Belt.List.has(4, (a, b) => a == b) /* false */

list{(-1), (-2), (-3)}->Belt.List.has(2, (a, b) => abs(a) == abs(b)) /* true */
```
@~@@~@@&getByU@@n!a @@ @
2@@@ @ ࠠ*Has_arity1
,@@ @A@@ @@ D@@ @ @ @	' Uncurried version of [getBy](#getBy). @@@@@%getBy@@!a @@ @@	%@@ @ k@@ @ @ @Πѐ
  0
Returns `Some(value)` for the first value in `someList` that satisfies the
predicate function `pred`. Returns `None` if no element satisfies the function.

## Examples

```rescript
Belt.List.getBy(list{1, 4, 3, 2}, x => x > 3) /* Some(4) */

Belt.List.getBy(list{1, 4, 3, 2}, x => x > 4) /* None */
```
@@@@@%keepU@@ɠ!a @@ @
@P@@ @ ࠠ*Has_arity1
@@ @A@@ @@ @@ @ @ @	% Uncurried version of [keep](#keep). @@@@@$keep@@!a @@ @@	@@ @ @@ @ @ @'$*
  :
Returns a list of all elements in `someList` which satisfy the predicate function `pred`.

## Examples

```rescript
let isEven = x => mod(x, 2) == 0

Belt.List.keep(list{1, 2, 3, 4}, isEven) /* list{2, 4} */

Belt.List.keep(list{None, Some(2), Some(3), None}, Belt.Option.isSome) /* list{Some(2), Some(3)} */
```
@2@@2@@&filter@@"!a @@ @@	@@ @ 2@@ @ @ @M*deprecatedQ	GThis function will soon be deprecated. Please, use `List.keep` instead."*j[@@[@X^
  >
Returns a list of all elements in `someList` which satisfy the predicate function `pred`.

## Examples

```rescript
let isEven = x => mod(x, 2) == 0

Belt.List.filter(list{1, 2, 3, 4}, isEven) /* list{2, 4} */

Belt.List.filter(list{None, Some(2), Some(3), None}, Belt.Option.isSome) /* list{Some(2), Some(3)} */
```
@f@@f@@.keepWithIndexU@@V!a @@ @@@_@@ @@ @ @ ࠠ*Has_arity2@@ @A@@ @@ y#@@ @ @ @	7 Uncurried version of [keepWithIndex](#keepWithIndex). @@@@@-keepWithIndex@@!a @@ @@	@@@ @@ @ @ @@ @ @ @Ð	
Returns a list of all elements in `someList` which satisfy the predicate function `pred`.

## Examples

```rescript
let isEven = x => mod(x, 2) == 0

Belt.List.keepWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) /* list{1, 3} */
```
@@@@@/filterWithIndex@@!a ~@@ y@@	@@@ zD@@ {@ |@ }Ѡ@@ @ @ @젠*deprecated𐠠	WThis function will soon be deprecated. Please, use `List.keepWithIndex` \
     instead.@@@	
Returns a list of all elements in `someList` which satisfy the predicate function `pred`.

## Examples

```rescript
let isEven = x => mod(x, 2) == 0

Belt.List.filterWithIndex(list{1, 2, 3, 4}, (_x, index) => isEven(index)) /* list{1, 3} */
```
@@@@@(keepMapU@@󠰐!a q@@ n@@!b u@@ r@ sࠠ*Has_arity1@@ o@A@@ p@@ t@@ v@ w@ x@0-3	+ Uncurried version of [keepMap](#keepMap). @;@@;@@'keepMap@@+!a g@@ f@@	𠰐!b j@@ h@ i@@@ k@ l@ m@[X^
  
Applies `f` to each element of `someList`. If `f(x)` returns `Some(value)`, then `value` is _kept_ in the resulting list.
If `f(x)` returns `None`, the element is _not_ retained in the result.

## Examples

```rescript
let isEven = x => mod(x, 2) == 0

list{1, 2, 3, 4}
->Belt.List.keepMap(x =>
    if (isEven(x)) {
      Some(x)
    } else {
      None
    }
  ) /* list{2, 4} */

list{Some(1), Some(2), None}->Belt.List.keepMap(x => x) /* list{1, 2} */
```
@f@@f@@*partitionU@@V!a a@@ Z@@@@ ]@ ^ࠠ*Has_arity1@@ [@A@@ \@@ _v @@ b{%@@ `@ c@ d@ e@	/ Uncurried version of [partition](#partition). @@@@@)partition@@!a U@@ Q@@	@@ R@ S@@ V@@ T@ W@ X@ Y@Ġǐ
  
Creates a pair of lists; the first list consists of all elements of `someList` that satisfy the predicate function `pred`; the second list consists of all elements of `someList` that _do not_ satisfy `pred.

In other words:

```rescript
(elementsThatSatisfies, elementsThatDoesNotSatisfy)
```

## Examples

```rescript
Belt.List.partition(list{1, 2, 3, 4}, x => x > 2) /* (list{3, 4}, list{1, 2}) */
```
@@@@@%unzip@@!a M!b K@ I@@ JҠ@@ Nנ@@ L@ O@ P@򠠠
  
Takes a list of pairs and creates a pair of lists. The first list contains all the first items of the pairs; the second list contains all the second items.

## Examples

```rescript
Belt.List.unzip(list{(1, 2), (3, 4)}) /* (list{1, 3}, list{2, 4}) */

Belt.List.unzip(list{("H", "W"), ("e", "o"), ("l", "r"), ("l", "l"), ("o", "d"), (" ", "!")})
/* (list{"H", "e", "l", "l", "o", " "}, list{"W", "o", "r", "l", "d", "!"}) */
```
@@@@@)getAssocU@@!a >!c D@ :@@ ;@!b ?@@@@@ @@ A@ Bࠠ*Has_arity2@@ <@A@@ =@@ CӠ&@@ E@ F@ G@ H@639	- Uncurried version of [getAssoc](#getAssoc). @A@@A@@(getAssoc@@1!a 0!c 5@ .@@ /@!b 1@@@
@@ 2@ 3@ 4
@@ 6@ 7@ 8@ 9@mjp
  
Return the second element of a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`, or `None` if not found.

## Examples

```rescript
list{(1, "a"), (2, "b"), (3, "c")}->Belt.List.getAssoc(3, (a, b) => a == b) /* Some("c") */

list{(9, "morning"), (15, "afternoon"), (22, "night")}
->Belt.List.getAssoc(15, (k, item) => k /* 15 */ == item /* 9, 5, 22 */)
/* Some("afternoon") */
```
@x@@x@@)hasAssocU@@h!a $!c @  @@ !@!b %@:@@@@ &@ '@ (ࠠ*Has_arity26@@ "@A@@ #@@ )@@ *@ +@ ,@ -@	- Uncurried version of [hasAssoc](#hasAssoc). @@@@@(hasAssoc@@!a !c @ @@ @!b @@@
>@@ @ @ B@@ @ @ @ @栠鐠
  
Returns `true` if there is a pair in `someList` where the first element equals `k` as per the predicate function `eqFunction`.

## Examples

```rescript
list{(1, "a"), (2, "b"), (3, "c")}->Belt.List.hasAssoc(1, (a, b) => a == b) /* true */

list{(9, "morning"), (15, "afternoon"), (22, "night")}
->Belt.List.hasAssoc(25, (k, item) => k /* 25 */ == item /* 9, 5, 22 */) /* false */
```
@@@@@,removeAssocU@@ᠰ!a !c @ @@ @!b @@@x@@ @ 	@ 
ࠠ*Has_arity2@@ @A@@ @@ -)@ @@ @ @ @ @-*0	3 Uncurried version of [removeAssoc](#removeAssoc). @8@@8@@+removeAssoc@@(!a !c @ @@ @!b @@@
@@ @ @ H @ @@ @  @ @ @gdj
  
Return a list after removing the first pair whose first value is `k` per the equality predicate `eqFunction`; if not found, return a new list identical to `someList`.

## Examples

```rescript
list{(1, "a"), (2, "b"), (3, "c")}->Belt.List.removeAssoc(1, (a, b) => a == b) /* list{(2, "b"), (3, "c")} */

list{(9, "morning"), (15, "afternoon"), (22, "night")}
->Belt.List.removeAssoc(9, (k, item) => k /* 9 */ == item /* 9, 5, 22 */)
/* list{(15, "afternoon"), (22, "night")} */
```
@r@@r@@)setAssocU@@b!a !c @ @@ @@	@2@@@@ @ @ 젰ࠠ*Has_arity2.@@ @A@@ @@ +'@ @@ @ @ @ @ @	- Uncurried version of [setAssoc](#setAssoc). @@@@@(setAssoc@@!a ߠ!c @ @@ ڰ@@	@@@8@@ @ @ ݰŠ@ @@ @ @ @ @ @䠠琠
  1
If `k` exists in `someList` by satisfying the `eqFunction` predicate, return a new list with the key and value replaced by the new `k` and `v`; otherwise, return a new list with the pair `k`, `v` added to the head of `someList`.

## Examples

```rescript
list{(1, "a"), (2, "b"), (3, "c")}->Belt.List.setAssoc(2, "x", (a, b) => a == b) /* list{(1, "a"), (2, "x"), (3, "c")} */

list{(1, "a"), (3, "c")}->Belt.List.setAssoc(2, "b", (a, b) => a == b) /* list{(2, "b"), (1, "a"), (3, "c")} */

list{(9, "morning"), (3, "morning?!"), (22, "night")}
->Belt.List.setAssoc(15, "afternoon", (a, b) => mod(a, 12) == mod(b, 12))
/* list{(9, "morning"), (15, "afternoon"), (22, "night")} */
```

**Please note**

In the last example, since: `15 mod 12` equals `3 mod 12`

Both the key _and_ the value are replaced in the list.
@@@@@%sortU@@ߠ!a @@ ΰ@@@@@ @ @ Ӡࠠ*Has_arity2@@ @A@@ @@ ԰@@ @ @ @	% Uncurried version of [sort](#sort). @$@@$@@$sort@@!a @@ ư@@	@@@ @ @ ɰ&@@ @ @ @A>D	
Returns a sorted list.

## Examples

```rescript
Belt.List.sort(list{5, 4, 9, 3, 7}, (a, b) => a - b) // list{3, 4, 5, 7, 9}
```
@L@@L@@)cartesian@U)function$@@I$list@!a @@ @!b @@ @ @@ @ @ Ġࠠ*Has_arity2@@@ @A@@ @@ @	3/Users/sminnee/Projects/res-suspenders/src/List.resD x |D x @@@         m   Y/List-Suspenders0s|$% N+PervasivesU0xiDAY=*Pervasives0NH-w|V=M֠.Belt_internals0jwn/<ܸ)Belt_List0*J9*\$Belt0TH ?J@               @