title: Haskell function to test if Int is perfect square using infinite list
body: <p>Purely for pleasure, and practice, I am trying to write a simple Haskell function to determine if an integer is a perfect square. Now I know that there are other solutions out there but I am wondering if there is a way to do it with an infinite list. I've started with this, but for clear reasons, it is not working (it never stops!)</p>
  
  <pre><code>    isSquare :: Integer -&gt; Bool
      isSquare n = sum[ 1 | x &lt;- [1..], x*x == n] /= 0
  </code></pre>
  
  <p>Also, if I might add, can someone point out how to search an infinite list for the first instance of something and then STOP! ?</p>