[Yhc] Yhc using mtl

Neil Mitchell ndmitchell at gmail.com
Wed Apr 11 18:50:03 EDT 2007


Hi Twan,

> Getting rid of the requirement for FlexibleInstances should not be to
> hard (nor should adding support for them to Yhc).

Sometimes adding support for things to Yhc is harder than you might
naturally think...

> But even if I work
> around that, this patch relies quite havilly on the mtl, which uses
> multi parameter type classes and functional dependencies. Those might be
> a bigger problem. Hoever the mtl was already used in other parts of the
> compiler...

There are two parts of the mtl - one provides monads, one provides
monad transformers. In general the monad half is Haskell 98, the
transformer half is not - we've been careful to stick to the monad
half so far. The mtl is actually being split soon into a Haskell 98
half and a MPTC/FD half.

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.

Thanks

Neil


More information about the Yhc mailing list