[Haskell-cafe] Trouble with the ST monad

Andre Nathan andre at digirati.com.br
Sun Dec 21 19:14:00 EST 2008


I'm trying to write a function that would take an STArray and and
shuffle its elements. I'm having trouble with the ST monad, though, and
couldn't find out how fix this issue.

The problem happens when I use runST to extract the shuffled array from
the ST monad. I'm getting the following error:

  Inferred type is less polymorphic than expected
    Quantified type variable `s' is mentioned in the environment:
      a :: STArray s Int a

The full code is at


Any help would be appreciated.


More information about the Haskell-Cafe mailing list