[Haskell] Data.Array.ST, polymorphism, and escaping type variables