<p dir="ltr">Haskell is a declarative language. The primary means of programming in a declarative language is to provide definitions for stuff, similar to mathematics. e.g. inc x = x + 1</p>
<p dir="ltr">If you want to define a value using an explicit sequence of steps, then you have to use monads. The Haskell wikibook has a good tutorial on using the state monad to generate random numbers. This allows mutation, preventing which is one of Haskell's prime features, so I wouldn't recommend wiring code like this.</p>
<p dir="ltr">Complexity analysis is usually tricky in Haskell. You can refer to the book 'purely functional days structures' to know more.</p>
<p dir="ltr">Regards,<br>
Sumit</p>