replacing the Prelude (again)
Bernard James POPE
Thu, 18 Jul 2002 15:52:18 +1000 (EST)
> On Tue, Jul 16, 2002 at 04:02:44PM +1000, Bernard James POPE wrote:
> > I would like to use do-notation in the transformed program, but have it
> > refer to Prelude.Monad and not MyPrelude.Monad which is also in scope.
> Why do you have a MyPrelude.Monad (different from Prelude.Monad) if
> you don't want to use it?
This is part of a debugger for haskell. The approach taken is to transform
the original program. Under transformation the types of functions change.
If the user's program calls >>=, then in the debugged program that is a
call to a transformed version of >>= (ie MyPrelude.Monad - don't worry it
isn't really called "MyPrelude"). Btw all do notation from the original
program is desugared during transformation.
It just turns out that the transformed code is neater if I can use
do notation in it. Which is quite helpful because it makes it easier to
check that the transformation is doing the right thing!
However, for this I have to use Prelude.Monad instead of MyPrelude.Monad,
because the latter is transformed and all the types are changed.
It really isn't a big deal. I can do without the do notation. I just have
to change the transformation. If there were more fine grained control about
how desugaring worked then that would help, but that would also add a lot
of extra complexity to the compiler and I doubt the benefits would outweigh