title: Haskell: Functions in list comprehensions
body: <p>I am teaching myself Haskell, and playing with list comprehensions. I wrote this list comprehension:</p>
  
  <pre><code>[ c | a &lt;- [1..3], b &lt;- [1..4], let c = hyp a b, c == round c]
  </code></pre>
  
  <p>I hoped it would produce the list of values c where c is an integer (c == round c), which would be only 5, but it does not compile. Playing around some more, I've found I can't really embed any functions in a list comprehension, I'm sure there is a way, I just don't know how.</p>
  
  <p>Here's the error code:</p>
  
  <pre><code>&lt;interactive&gt;:158:1: error:
      • Ambiguous type variable ‘t0’ arising from a use of ‘it’
        prevents the constraint ‘(Floating t0)’ from being solved.
        Probable fix: use a type annotation to specify what ‘t0’ should be.
        These potential instances exist:
          instance Floating Double -- Defined in ‘GHC.Float’
          instance Floating Float -- Defined in ‘GHC.Float’
      • In the first argument of ‘print’, namely ‘it’
        In a stmt of an interactive GHCi command: print it
  </code></pre>
  
  <p>Thanks!</p>