title: Why does "take" change datatype in haskell?
body: <p>I'm writing a function which takes elements from a list and returns them.</p>
  
  <p>Pretty simple I thought. But when using "take" in for example: <code>take 2 [1.2,3,4]</code></p>
  
  <p>it returns: <code>[1.2,3.0]</code> when I actually want <code>[1.2, 3]</code></p>
  
  <p>I thought for creating a function that goes through the list and cuts unnecessary decimals but I can't get my head around it seeing haskell doesn't accept my comparison with x &amp; round(x) in </p>
  
  <pre><code>function :: [a] -&gt; [a]
  function(x:xs)
   if x == round(x) = round(x):function xs
   else x:function xs
  </code></pre>
  
  <p>So A: Are there any simpler solutions?
  B: Why can't haskell compare x with round(x)?</p>