title: Haskell Couldn't match type ‘String -> [Int]’ with ‘[a0]’
body: <p>I want to create a program counting occurrence of all elements in a list and return max sequence. I have a problem with my input part. </p>
  
  <p>The input consists of several test cases. Each test case starts with a line containing two integers n and q (1 ≤ n, q ≤ 100000). The next line contains n integers a1 , ... , an (-100000 ≤ ai ≤ 100000</p>
  
  <p>I want readNQ to get n and q as [int] then pass to readArray that will read n element and assign to [int] as following</p>
  
  <pre><code>module Main where
  
  import Text.Printf
  import Data.List
  
  main :: IO()
  main = interact (showResults . maxSeqLength . readArray. readNQ)
  
  readNQ :: String -&gt; [Int]
  readNQ =  take 2 . (map read) . words
  
  readArray :: [Int] -&gt; String -&gt; [Int]
  readArray (n:xs) = take n . (map read) . words
  
  
  showResults ::  Int -&gt; String
  showResults x = printf "\n %d" x
  
  maxSeqLength :: Eq a =&gt; [a] -&gt; Int
  maxSeqLength [] = 0
  maxSeqLength xs = (maximum . map length . group) xs
  </code></pre>
  
  <p>However, there is an error.</p>
  
  <p>frequent.hs:13:47: error:</p>
  
  <pre><code>• Couldn't match type ‘String -&gt; [Int]’ with ‘[a0]’
    Expected type: String -&gt; [a0]
      Actual type: String -&gt; String -&gt; [Int]
  • Probable cause: ‘(.)’ is applied to too few arguments
    In the second argument of ‘(.)’, namely ‘readArray . readNQ’
    In the second argument of ‘(.)’, namely
      ‘maxSeqLength . readArray . readNQ’
    In the first argument of ‘interact’, namely
      ‘(showResults . maxSeqLength . readArray . readNQ)’
  </code></pre>
  
  <p>what is wrong with the type of readNQ and readArray?</p>