title: Type error in application - Haskell?
body: <p>type Car = (String, [String], Int, [String])</p>
  
  <pre><code>carToString :: [Car] -&gt; IO()
  carToString [] = putStr ""
  carToString (x:xs) = putStr x ++ "\n" : putStr xs ++ "\n"
  
  displayAllCars :: IO ()
  displayAllCars = putStr carToString testDatabase --&lt; test data in the format of type Car
  </code></pre>
  
  <p>this gives me the error:</p>
  
  <pre><code>ERROR file:.\template.hs:26 - Type error in application
  *** Expression     : putStr xs
  *** Term           : xs
  *** Type           : [([Char],[[Char]],Int,[[Char]])]
  *** Does not match : [Char]
  </code></pre>
  
  <p>What is the cause of this error and how do I correct it?</p>