Hugs treats runST as a keyword. The relevant syntax rule is something
like this:
expr :== "runST" expr
If runST had a type, the type would be:
runST :: forall a. (forall s. ST s a) -> a
But, this is not a legal type under Hindley-Milner type systems
(the second forall isn't at the top level) so
Hugs achieves the same effect by adding a special type rule for
runST.
Details are in the Peyton-Jones/Launchbury paper cited in the user
manual.
Alastair
> (Usual apologies if this has been reported before, I've had a quick
> scan of the archive and the known bugs but couldn't find anything.)
>
> I know that the type of `runST' is not within the realms of standard
> Haskell but I've noticed some odd behaviour from Hugs (971118):
>
> Prelude> :i runST
> runST :: <unknown type> -- primitive
>
> Prelude> :n runST
> runST
> (1 names listed)
> Prelude> :t runST
> ERROR: Syntax error in expression (unexpected end of input)
> Prelude> :l ST