Re: [Haskell-cafe] ReadP and MonadFix

2006-06-24 Thread Gracjan Polak

Thanks for your response!

I searched for something more found: An Abstract Monadic Semantics for
Value Recursion, Eugenio Moggi, Amr Sabry

http://citeseer.ist.psu.edu/moggi03abstract.html

Section 4 of this paper says something about References and
Continuations. But it will be quite hard to translate this into actual
code. Could you please point me to the running examples you were
talking about?

I'm going to create MonadFix instance for the P monad and then I'll
see what can I achieve with that.

2006/6/23, Levent Erkok <[EMAIL PROTECTED]>:

Gracjan:

To declare "ReadP" an instance of MonadFix; you'll first have to make the P
monad into a MonadFix instance. That can be done using existing techniques
in the literature.

ReadP is essentially the continuation monad transformer wrapped around P.
It's well known in the value-recursion literature that continuation monad is
too "strong" to have a value-recursion operator. I am not aware of any
"simple" solutions in that space. Hence, ReadP is beyond the realm of
current theories of value recursion.

Having said that, I'd also like to point out that Amr Sabry and Eugenio
Moggi, and independently  Magnus Carlsson has done some interesting work to
extend value recursion to the world of continuations;



which might help with

your particular problem. Essentially, you end up adding some extra
infrastructure to your monad, and then forgo some of the basic axioms of
value recursion. But you can get running examples!

Maybe all you'll need is a MonadFix instance of P; which is definitely
doable with the current techniques. Anything further would actually make a
nice research paper...

-Levent. (I could provide references to above work if needed; all is
available on the net freely, anyhow.)


On 6/23/06, Gracjan Polak <[EMAIL PROTECTED]> wrote:
>
 Hi all,

A question for hot summer day:
Text.ParserCombinators.ReadP.ReadP is
an instance of Monad. Could it be an instance of MonadFix too?

I'm not that sharp in Haskell to write it myself, but it seems I could
make use of such a beast. :) Anybody willing to share?

This will also present the advantage of Lazy over Eager Parser
Combinators, mentioned in some other thread.

--
Gracjan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ReadP and MonadFix

2006-06-23 Thread Levent Erkok
Gracjan:To declare "ReadP" an instance of MonadFix; you'll first have to make the P monad into a MonadFix instance. That can be done using existing techniques in the literature.ReadP is essentially the continuation monad transformer wrapped around P. It's well known in the value-recursion literature that continuation monad is too "strong" to have a value-recursion operator. I am not aware of any "simple" solutions in that space. Hence, ReadP is beyond the realm of current theories of value recursion.
Having said that, I'd also like to point out that Amr Sabry and Eugenio Moggi, and independently  Magnus Carlsson has done some interesting work to extend value recursion to the world of continuations; which might help with your particular problem. Essentially, you end up adding some extra infrastructure to your monad, and then forgo some of the basic axioms of value recursion. But you can get running examples!
Maybe all you'll need is a MonadFix instance of P; which is definitely doable with the current techniques. Anything further would actually make a nice research paper...-Levent. (I could provide references to above work if needed; all is available on the net freely, anyhow.)
On 6/23/06, Gracjan Polak <[EMAIL PROTECTED]> wrote:
Hi all,A question for hot summer day: Text.ParserCombinators.ReadP.ReadP isan instance of Monad. Could it be an instance of MonadFix too?I'm not that sharp in Haskell to write it myself, but it seems I could
make use of such a beast. :) Anybody willing to share?This will also present the advantage of Lazy over Eager ParserCombinators, mentioned in some other thread.--Gracjan___
Haskell-Cafe mailing listHaskell-Cafe@haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ReadP and MonadFix

2006-06-23 Thread Gracjan Polak

Hi all,

A question for hot summer day: Text.ParserCombinators.ReadP.ReadP is
an instance of Monad. Could it be an instance of MonadFix too?

I'm not that sharp in Haskell to write it myself, but it seems I could
make use of such a beast. :) Anybody willing to share?

This will also present the advantage of Lazy over Eager Parser
Combinators, mentioned in some other thread.

--
Gracjan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe