[Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

David Menendez dave at zednenem.com
Fri May 21 13:12:15 EDT 2010


On Fri, May 21, 2010 at 3:56 AM, Max Bolingbroke
<batterseapower at hotmail.com> wrote:
> On 21 May 2010 01:58, Carlos Camarao <carlos.camarao at gmail.com> wrote:
>> But this type-correct program would become not typeable if
>> instances such as the ones referred to before (by Daniel Fischer)
>
> I was thinking this through, and the situation is more complex than I
> had thought.
>
> It seems that single param type classes enjoy a nice property:
> * Adding an instance to the module defining the class cannot conflict
> with any non-orphan instance defined elsewhere
> * Adding an instance for a type for a class *to the module defining
> that type* cannot conflict with any non-orphan instance defined
> elsewhere

This is only true in the absence of recursive imports. Otherwise,
those points imply that I can put one instance in the module defining
the type and another in the module defining the class without
conflict.

-- 
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list