[Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Stefan Klinger
Hello! Nice, Parsec 3 comes with a monad transformer [1]. So I thought I could use IO as inner monad, and perform IO operations during parsing. But I failed. Monad transformers still bend my mind. My problem: I don't see a function to actually lift the IO operation into the ParsecT. It should be

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Gregory Collins
Stefan Klinger all-li...@stefan-klinger.de writes: Hello! Nice, Parsec 3 comes with a monad transformer [1]. So I thought I could use IO as inner monad, and perform IO operations during parsing. But I failed. Monad transformers still bend my mind. My problem: I don't see a function to

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Luke Palmer
On Thu, Mar 18, 2010 at 10:37 AM, Stefan Klinger all-li...@stefan-klinger.de wrote: Hello! Nice, Parsec 3 comes with a monad transformer [1]. So I thought I could use IO as inner monad, and perform IO operations during parsing. But I failed. Monad transformers still bend my mind. My problem:

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Stefan Klinger
On 18 March 2010, Gregory Collins wrote with possible deletions: ParsecT has a MonadIO instance: class Monad m = MonadIO m where liftIO :: IO a - m a Thank you! I didn't see this. Great! Kind regards, Stefan -- Stefan Klinger o/klettern

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Job Vranish
Hoogle is a great tool for finding haskell functions: http://www.haskell.org/hoogle/ You can punch in the type of a function you want and it will give you a list of functions that might do what you need. Generalizing the types a bit usually helps. Searching for either m a - n m a or IO a -

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Andrew Coppin
Job Vranish wrote: Hoogle is a great tool for finding haskell functions: http://www.haskell.org/hoogle/ You can punch in the type of a function you want and it will give you a list of functions that might do what you need. Generalizing the types a bit usually helps. Searching for either m a

Re: [Haskell-cafe] Parsec monad transformer with IO?

2010-03-18 Thread Stephen Tetley
On 18 March 2010 21:34, Andrew Coppin andrewcop...@btinternet.com wrote: Is there a tool anywhere which can figure out how to construct a function with a specific type signature? Hoogle works if the thing you seek is a single function, but not so much if you need to throw several functions