Haskell extracting from tuples within a list : <p>I'm a beginner, any help will be appreciated. My goal is to be able to extract the ratings from any given <strong>Film</strong> as a <strong>Float</strong> so I can then manipulate the data properly, for instance give the "average rating" for a film.</p>

<pre><code>type Title = String
type Director = String
type Year = Int
type Mark = Int
type Rating = (String, Float)

-- Define Film type here
type Film = (Title, Director, Year, [Rating])
</code></pre>

<p>A typical <strong>Film</strong> looks like </p>

<pre><code>("True Lies", "James Cameron", 1994, [("Dave",3), ("Kevin",10), ("Jo",0)])
</code></pre>

<p>I have tried </p>

<pre><code>extractRating :: Film -&gt; [(String, Float)]
extractRating (_, _, _, rating) = rating  
</code></pre>

<p>Then calling the function like this</p>

<pre><code>putStrLn (extractRating "True Lies")
</code></pre>

<p>If it helps you help me here this the error dump</p>

<pre><code>haskell.hs:82:21:
Couldn't match type ‘(String, Float)’ with ‘Char’
Expected type: String
  Actual type: [(String, Float)]
In the first argument of ‘putStrLn’, namely
  ‘(extractRating "True Lies")’
In a stmt of a 'do' block: putStrLn (extractRating "True Lies")

haskell.hs:82:35:
Couldn't match type ‘[Char]’
               with ‘(Title, Director, Year, [Rating])’
Expected type: Film
  Actual type: [Char]
In the first argument of ‘extractRating’, namely ‘"True Lies"’
In the first argument of ‘putStrLn’, namely
  ‘(extractRating "True Lies")’
In a stmt of a 'do' block: putStrLn (extractRating "True Lies")
</code></pre>
