fsprojects/FSharpx.Collections


List

Namespace: FSharpx.Collections

Extensions for F#'s List module.

Functions and values

Function or valueDescription
catOptions xs
Signature: xs:Option<'a> list -> '?9361 option list -> '?9361 list
Type parameters: 'a, '?9361

The catOptions function takes a list of Options and returns a list of all the Some values.

choice1s xs
Signature: xs:Choice<'?9363,'?9364> list -> '?9363 list
Type parameters: '?9363, '?9364

Extracts from a list of Choice all the Choice1Of2 elements. All the Choice1Of2 elements are extracted in order.

choice2s xs
Signature: xs:Choice<'?9366,'?9367> list -> '?9367 list
Type parameters: '?9366, '?9367

Extracts from a list of Choice all the Choice2Of2 elements. All the Choice2Of2 elements are extracted in order.

cons hd tl
Signature: hd:'a -> tl:'a list -> 'a list
Type parameters: 'a

Curried cons

equalsWith eq xs ys
Signature: eq:('?9372 -> '?9372 -> bool) -> xs:'?9372 list -> ys:'?9372 list -> bool
Type parameters: '?9372

Compares two lists for equality using the given comparison function, element by element.

fill total elem list
Signature: total:int -> elem:'a -> list:'a list -> 'a list
Type parameters: 'a
groupNeighboursBy projection source
Signature: projection:('T -> 'Key) -> source:'T list -> ('Key * 'T list) list
Type parameters: 'T, 'Key

Applies a key-generating function to each element of a list and yields a list of unique keys and a list of all elements that have each key. This function groups together only neighbouring elements in the list.

lift2 f l1 l2
Signature: f:('?9318 -> '?9319 -> '?9320) -> l1:'?9318 list -> l2:'?9319 list -> '?9320 list
Type parameters: '?9318, '?9319, '?9320
mapAccum f s l
Signature: f:('?9345 -> '?9346 -> '?9345 * '?9347) -> s:'?9345 -> l:'?9346 list -> '?9345 * '?9347 list
Type parameters: '?9345, '?9346, '?9347

Behaves like a combination of map and fold; it applies a function to each element of a list, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list.

mapIf pred f
Signature: pred:('?9343 -> bool) -> f:('?9343 -> '?9343) -> '?9343 list -> '?9343 list
Type parameters: '?9343
merge a b
Signature: a:'?9354 list -> b:'?9354 list -> '?9354 list
Type parameters: '?9354

Merges two sequences by the default comparer for 'T

mergeBy f a b
Signature: f:('?9351 -> '?9352) -> a:'?9351 list -> b:'?9351 list -> '?9351 list
Type parameters: '?9351, '?9352

Merges to sequences using the given function to transform the elements for comparision

pad amt elem list
Signature: amt:int -> elem:'a -> list:'a list -> 'a list
Type parameters: 'a
partitionChoices xs
Signature: xs:Choice<'?9369,'?9370> list -> '?9369 list * '?9370 list
Type parameters: '?9369, '?9370

Partitions a list of Choice into two lists. All the Choice1Of2 elements are extracted, in order, to the first component of the output. Similarly the Choice2Of2 elements are extracted to the second component of the output.

singleton x
Signature: x:'?9316 -> '?9316 list
Type parameters: '?9316
skip n l
Signature: n:int -> l:'?9336 list -> '?9336 list
Type parameters: '?9336
skipUntil pred l
Signature: pred:('?9328 -> bool) -> l:'?9328 list -> '?9328 list
Type parameters: '?9328
skipWhile pred l
Signature: pred:('?9326 -> bool) -> l:'?9326 list -> '?9326 list
Type parameters: '?9326
span pred l
Signature: pred:('?9322 -> bool) -> l:'?9322 list -> '?9322 list * '?9322 list
Type parameters: '?9322
split pred l
Signature: pred:('?9324 -> bool) -> l:'?9324 list -> '?9324 list * '?9324 list
Type parameters: '?9324
splitAt n l
Signature: n:int -> l:'?9334 list -> '?9334 list * '?9334 list
Type parameters: '?9334
take n l
Signature: n:int -> l:'?9338 list -> '?9338 list
Type parameters: '?9338
takeUntil pred l
Signature: pred:('?9332 -> bool) -> l:'?9332 list -> '?9332 list
Type parameters: '?9332
takeWhile pred l
Signature: pred:('?9330 -> bool) -> l:'?9330 list -> '?9330 list
Type parameters: '?9330
transpose lst
Signature: lst:'?9349 list list -> '?9349 list list
Type parameters: '?9349
Fork me on GitHub