In Haskell, I can easily map a list:
map (x -> 2*x) [1,2]
gives me [2,4]
. Is there any "mapTuple" function which would work like that?
mapTuple (x -> 2*x) (1,2)
with the result being (2,4)
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…