Java-like
Bulat Ziganshin
bulatz at HotPOP.com
Tue Feb 7 07:01:54 EST 2006
Hello haskell-prime,
about limiting variable usage inside a function to some interface - it
is possible, although is not pleasant :)
{-# OPTIONS_GHC -fglasgow-exts #-}
main = do return "xx" >>= ((\x -> print x) :: Show a => a -> IO ())
main2 = do return "xx" >>= (\(x:: (forall a . (Show a) => a)) -> print x)
main3 = do (x :: forall a . Show a => a) <- return "xx"
print x
in this module, only "main" compiles ok
--
Best regards,
Bulat mailto:bulatz at HotPOP.com
More information about the Haskell-prime
mailing list