Common functions
Functions available in multiple modules, each version customized for its target type
Access to an element
↓ Access \ Return element →
Directly or 💣
Optionally
[1; 2] |> List.tryHead // Some 1
[1; 2] |> List.tryItem 2 // NoneCost ⚠️
↓ Function \ Module →
Array
List
Seq
Combine collections
Function
Parameters
Final size
Find an element
↓ Which element \ Returns →
Direct or 💣
Optional
Search elements
Search
How many items
Function
Select elements
↓ Which elements \ Search →
By size
By predicate
Map elements
Function
Mapping f
Returns
How many elements?
map vs mapi
map vs mapiAlternative to mapi
mapimap vs iter
map vs iterchoose, pick, tryPick
choose, pick, tryPickAggregate
Specialized aggregate functions
Direct
By projection
Mapping
Constraint
CountBy
Max(By), Min(By)
Sum(By), Average(By)
Monoid constraint
Versatile aggregate functions
Fold(Back) versatility
Change the order of elements
Operation
Direct
Mapping
Separate
Operation
Result (; omitted)
Remark
Group items
By size
Operation
Result (' and ; omitted)
Remark
By criteria
Operation
Criteria
Result
Change collection type
Functions vs comprehension
Additional resources
Last updated