Convenience functions for working with 2-tuples.
Create a 2-tuple.
double 0 --> (0, 0)Swap the values in a 2-tuple.
swap ( '1', "1" ) --> ("1", '1')Apply each value in a 2-tuple to a function that takes at least 2 arguments.
uncurry List.repeat ( 3, 'a' ) --> ['a', 'a', 'a']Apply the second value in a 2-tuple to the function in the first position.
apply (String.toLower, "HELLO") --> "hello"
Apply a function that produces a Maybe to the first value in a 2-tuple. If
it returns Just something, pair the something back with the second value in
the 2-tuple.
("1", "horse")
|> maybeMapFirst String.toInt
--> Just (1, "horse")
("One", "horse")
|> maybeMapFirst String.toInt
--> NothingApply a function that produces a Maybe to the second value in a 2-tuple.
If it returns Just something, pair the something back with the first value in
the 2-tuple.
("King", ["Kong", "Kunta", "Henry VIII"])
|> maybeMapSecond List.head
--> Just ("King", "Kong")
Create a 2-tuple.