Function uncurry
converts a two-argument (curried) function into a function on pairs. Here's its type signature:
uncurry :: (a -> b -> c) -> (a, b) -> c
You need to use it on printf
, like this:
mapM_ (uncurry $ printf "Values: %d %d
") [(1,100),(2,350),(3,600),(4,200)]
Another solution is to use pattern matching to deconstruct the tuple, like this:
mapM_ ((a,b) -> printf "Values: %d %d
" a b) [(1,100),(2,350),(3,600),(4,200)]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…