Does haskell have a splat operator like python/ruby?
Question: In python / ruby (and others, I'm sure). you can prefix an enumerable with *
("splat") to use it as an argument list. e.g in python:

    
    
    >>> def foo(a,b): return a + b
    >>> foo(1,2)
    3
    >>> tup = (1,2)
    >>> foo(*tup)
    3
    

Is there something similar in haskell? I assume it wouldn't work on lists due
to their unknown length, but I feel that tuples ought to work. Here's an
example of what I'd like:

    
    
    ghci> let f a b = a + b
    ghci> :t f
    f :: Num a => a -> a -> a
    ghci> f 1 2
    3
    ghci> let tuple = (1,2)
    

I'm looking for an operator (or function) that allows me to do:

    
    
    ghci> f <op> tuple
    3
    

I have seen <*> being called "splat", but it doesn't seem to be referring to
the same thing as splat in other languages. I tried it anyway:

    
    
    ghci> import Control.Applicative
    ghci> f <*> tuple
    
    <interactive>:1:7:
        Couldn't match expected type `b0 -> b0'
                    with actual type `(Integer, Integer)'
        In the second argument of `(<*>)', namely `tuple'
        In the expression: f <*> tuple
        In an equation for `it': it = f <*> tuple
    


Answer: Yes, you can apply functions to tuples, using the
[tuple](http://hackage.haskell.org/package/tuple) package. Check out, in
particular, the
[uncurryN](http://hackage.haskell.org/packages/archive/tuple/0.2.0.1/doc/html/Data-
Tuple-Curry.html) function:

    
    
    Prelude Data.Tuple.Curry> (+) `uncurryN` (1, 2)
    3
    

