title: Passing a dictionary and searching a set of values and returning another dictionary in haskell
body: <p>I was writing a code that accepts a <code>dictionary</code> and a <code>array of keys</code> and check the dictionary and see if that key is in the dictionary or not, if it is not there leave it, else send back the dictionary of those keys and values whose keys are in the dictionary</p>
  
  <p>I wore the code but i am getting too many errors</p>
  
  <pre><code>let x = check dict key
  putStrLn $ show (x)
  
  check :: Eq k =&gt; [(k, v)] -&gt;[k] -&gt; [(k,v)]
  check dict words = [findVal word dict | word &lt;- words]
  
  findVal :: (Eq k) =&gt; k -&gt; [(k,v)] -&gt; [(k, v)]
  findVal key xs = foldr (\(k,v) acc -&gt; case key == k of True -&gt; (k,v)
                                                         False -&gt;   acc) xs
  </code></pre>
  
  <p>The errors are that the data type of 2 functions and ever the cse is also an error </p>