Is there a function or functions in Haskell that takes n arguments and returns an n-tuple? For instance:
make3tuple:: a -> a -> a -> (a,a,a)
make3tuple a b c = (a,b,c)
i.e.: as a comma, but for more than two arguments. Obviously, make3tuple does the job, but I feel there must be a built-in way to do this, and I have not found it, or have missed some way to use some other ubiquitous function.
FWIW, this occurs when using liftM3 (or higher). For instance:
type RandomState a = State StdGen a
[...]
getTwoRandoms = liftM2 (,) getRandom getRandom
get3Randoms = liftM3 make3tuple getRandom getRandom getRandom
Thank!
source
share