Haskell couldn't match 't0 ->t' with actual type '[Integer]' : <p>I am learning Haskell and after grasping some of the basics I decided to solve some easy problems in HackerRank. But I soon found myself stuck.</p>

<p>Problem 7 in Functional Problems is called "Array of N elements"</p>

<p>We are supposed to return any array of n elements for a given n. This would have fairly simple if n was an Int but it's read as <code>IO Int</code>. And I haven't really grasped the concept of monads. I hoogled for functions with type signature <code>IO Int -&gt; Int</code> and found unsafePerform IO but it threw this:</p>

<pre><code>Couldn't match expected type ‘t0 -&gt; t’
              with actual type ‘[Integer]’
</code></pre>

<p>I dont't quite understand what types t0 and t are.</p>

<p>Any help is appreciated.</p>

<p>Link: <a href="https://www.hackerrank.com/challenges/fp-array-of-n-elements/problem" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/fp-array-of-n-elements/problem</a></p>
