Re: [Haskell-cafe] Lifting an enumerator

2011-08-25 Thread Michael Snoyman
On Thu, Aug 25, 2011 at 3:46 AM, John Lato jwl...@gmail.com wrote: Message: 17 Date: Wed, 24 Aug 2011 17:02:49 +0300 From: Michael Snoyman mich...@snoyman.com Subject: [Haskell-cafe] Lifting an enumerator To: Haskell Cafe haskell-cafe@haskell.org Cc: John Millikin jmilli...@gmail.com

[Haskell-cafe] Lifting an enumerator

2011-08-24 Thread Michael Snoyman
Hi all, Max asked earlier[1] how to create a new instance of a class in Persistent using a monad transformer. Without getting into the specific details of persistent, I wanted to pose a question based on a much more general question: how can we lift the inner monad of an enumerator? We can easily

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Lenz
On 08/24/2011 09:02 AM, Michael Snoyman wrote: Hi all, Max asked earlier[1] how to create a new instance of a class in Persistent using a monad transformer. Without getting into the specific details of persistent, I wanted to pose a question based on a much more general question: how can we

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Millikin
The type signature liftEnum :: (Monad m, MonadTrans t) = Enumerator a m b - Enumerator a (t m) b expands to: liftEnum :: (Monad m, MonadTrans t) = (Step a m b - Iteratee a m b) - Step a (t m) b - Iteratee a (t m) b So you could implement it iff you can define: lower :: (Monad m,

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread Michael Snoyman
Actually, I'm looking for a slightly different type signature. Look at how I've implemented the special case of ErrorT: liftEnum :: Enumerator In IO (Either OcrError Out) - Enumerator In (ErrorT OcrError IO) Out There's a slightly different value for b, which is what keeps track of the

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Lato
Message: 17 Date: Wed, 24 Aug 2011 17:02:49 +0300 From: Michael Snoyman mich...@snoyman.com Subject: [Haskell-cafe] Lifting an enumerator To: Haskell Cafe haskell-cafe@haskell.org Cc: John Millikin jmilli...@gmail.com Message-ID:        caka2jgkf0dn4n8ge1_q-zemlzm93bwg_fjmtbazgzrc2gqn