Re: parsing types

2011-04-23 Thread Ranjit Jhala
Hi Daniel -- that was a good lead, with a little digging around, I found hscTcExpr :: GhcMonad m => HscEnv -> String -> m Type which almost gets the job done, if only I could call it with the appropriate HscEnv. The one I get using getSession :: GhcMonad m => m HscEnv appea

Are FFI calls interruptible?

2011-04-23 Thread Bas van Dijk
Hello, Quick question: are safe/unsafe FFI calls interruptible? Thanks, Bas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: parsing types

2011-04-23 Thread Daniel Peebles
I don't have an answer for you, but you might want to look at what :k does in ghci, since that needs to parse a type. On Sat, Apr 23, 2011 at 2:06 PM, Ranjit Jhala wrote: > Hi all, > > can someone give me a hint as to the best way to parse a type from a > string. > Ideally, I'd like a function >

parsing types

2011-04-23 Thread Ranjit Jhala
Hi all, can someone give me a hint as to the best way to parse a type from a string. Ideally, I'd like a function stringType :: String -> Maybe Type or possibly, stringType :: (GhcMonad m) => String -> m (Maybe Type) such that, stringType s == Just t if in the curr