The following program compiles under ghc, but hugs complains that there is an unexpected keyword "forall" on the line defining the type X. The type used is the type of the primitive runST, so it is a valid type. It seems that one should be able to create a type synonym for it. The situation is unchanged if the type X is given a parameter a, i.e. "type X a = (forall s. ST s a) -> a".
 
module Main where

import ST

type Module s a = ST s a

type X = (forall s. ST s a) -> a
f :: (forall s. ST s a) -> a
f x = undefined
--type ModuleConnect = forall s. (forall t. ST (s, t) a) -> ST s a

main :: IO ()
main =
  do { putStrLn "Hello World!!!"
     }
 

Reply via email to