Closed gampleman closed 3 months ago
I would vote for adding it to the existing Tuple
library, since the data type is a tuple, just with three values (not two).
I'm not unconvinced it shouldn't just be called Triple
(too many negations...)
I think we could just call it Triple
One of the types where an -extra library would be handy are triples
(a, b, c)
.Does it make sense to add such a library? Should it go into
Tuple.Extra
or should we make a new name for it?Triple.Extra
?Some candidate functions:
triple : a -> b -> c -> (a, b, c)
first : (a, b, c) -> a
second : (a, b, c) -> b
third : (a, b, c) -> c
mapFirst
,mapSecond
,mapThird
map : (a -> b) -> (a, a, a) -> (b, b, b)
mapAll : (a -> x) -> (b -> y) -> (c -> z) -> (a, b, c) -> (x, y, z)
from : a -> (a, a, a)
Tuple.Extra
functions, although perhaps we could wait for demand there...