[Yhc] Yhc using mtl

Twan van Laarhoven twanvl at gmail.com
Wed Apr 11 19:45:17 EDT 2007


Hi,

Here is a patch that no longer needs flexible instances. It also
includes the previous patch, it seems darcs send diffs against the only
repository. Again, the patch is too big to send by email to this list, 
so it can be downloaded from
  http://twan.home.fmf.nl/yhc-mtl-no-flex.patch.gz

I added a HasIntState class as suggested in my previous post. I also had
to wrap a newtype around some monads that did not comply. As an added
bonus ByteCode.Compiler and DotNet.Compiler now use an actual writer
monad instead of manual plumbing.

Neil Mitchell wrote:
> How much of the transformer side do you use, and how hard would it be
> to remove that? From my limited knowledge of mtl, I believe you can
> write your own custom instance for any given combination - which
> removes the type class requirement. If that is so, that may be an
> option.

I use get, put, ask, locally, etc. rather heavily, but that could
changed to something more specific using search/replace on a per module
bases. I already did this partially when switching to newtypes for the
renamer and import monads.

Twan


More information about the Yhc mailing list