title: Using condition in list comprehension in haskell
body: <p>I want to use list comprehension to print only true</p>
  
  <pre><code>listTo::(a-&gt;b)-&gt;[a]-&gt;[b]
  listTo f list=[f(x)|x&lt;-list,x==True]
  
  isTrue::Int-&gt;Bool
  isTrue n
      |n&gt;=5 =True
      |n&lt;5 =False
  
  
  listTo isTrue[1,2,3,4,5,6,7]
  </code></pre>
  
  <p>But this doesn't work. Why is it?</p>