title: Syntax for functions that take in or return functions in Haskell
body: <p>I'm learning Haskell via Learn You a Haskell and I'm pretty sure he went over this at some point but I can't figure out where. Say I want to have a function return a pair, list of pairs, or general tuple. How is the type signature for this written? For example, for some given even number I want to return the list of unique pairs of primes that add up to it. I have a function <code>isPrime</code> that tells whether or not an <code>Int</code> is a prime. </p>
  
  <pre class="lang-hs prettyprint-override"><code>pairs :: Int -&gt; [(Int a, Int b)]
  pairs n
    | n &lt; 4 = []
    | odd n = []
    | otherwise = [(a, b) | a &lt; b, isPrime a, isPrime b, a+b == 1]
  </code></pre>
  
  <p>When I try to compile this, I get the error saying "Int has too few arguments." So I tried the following syntax instead:</p>
  
  <pre class="lang-hs prettyprint-override"><code>pairs :: Int -&gt; [((Int a), (Int b))]
  </code></pre>
  
  <p>But I got the same error. So in general how does typesetting functions involving pairs work?</p>