title: How to check if the last element of a list is a member of another list?
body: <p>I'm having some troubles with lists. </p>
  
  <p>I have the following lists of lists:</p>
  
  <pre><code>sentence = [['t','h','e'], ['b','o','y'],['i','s'],['h','a','p','p','y']]
  
  shortVowel = [['a'], ['e'], ['y']]
  </code></pre>
  
  <p>I need to make an if statement that checks 2 things: </p>
  
  <p>(1) if an element x is a member of the last "sublist" (whose, of course, is the last element of the main list),</p>
  
  <p>and (2) if an element (a sublist) of the list <code>shortVowel</code> is the last member of the last sublist.   </p>
  
  <p>The (1) I was able to do with <code>elem 'а' (last sentence))</code> (checking if 'a'is a member of <code>['h','a','p','p','y']</code>, which it is.</p>
  
  <p>The (2) is the one I don't know how to get.</p>
  
  <p>For exemple, the last element of the last sublist in <code>sentence</code> is <code>y</code> (from happY). And <code>y</code> is also a sublist in the <code>shortVowel</code> list. </p>
  
  <p>I need to check exactly this. </p>
  
  <p>I try some things, like <code>elem shortVowel (last sentence)</code>, but it didn't work.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>import Data.List
  
  sentence = [['t','h','e'], ['b','o','y'],['i','s'],['h','a','p','p','y']]
  
  shortVowel = [['a'], ['e'], ['y']]
  
  main =  if ((elem 'а' (last sentence)) || (elem 'о' (last sentence)) || (elem 'у' (last sentence)) &amp;&amp; (elem shortVowel (last sentence)))
             then putStrLn "A"
          else if (elem 'р' (last sentence))
             then putStrLn "B"
          else putStrLn "C"
  </code></pre>