[Haskell-cafe] Associated types

David Menendez dave at zednenem.com
Thu Jul 1 14:48:01 EDT 2010


On Thu, Jul 1, 2010 at 2:35 PM, Christopher Lane Hinson
<lane at downstairspeople.org> wrote:
> On Thu, 1 Jul 2010, Christopher Lane Hinson wrote:
>
>>
>>> Something like this should work:
>>>
>>> class (Path p, CompletePath (CompletedPath p)) => IncompletePath p where
>>>   type CompletedPath p :: *
>>>
>>
>> AIUI, this isn't implemented yet.  You'll have to place the constraint on
>> each
>> involved function.
>>
>> Friendly,
>> --Lane
>
> I would have sworn I tested this in 6.12.x, but I'm wrong.  It works.
>
> Isn't there something left unimplemented that I am thinking of?  Tell me
> I'm not crazy!

Maybe you're thinking of equality superclasses. In another thread,
this example came up:

| class (DerivedOf a ~ derived) => Typecheck a derived where

which doesn't work yet, but should work in 6.14.

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


More information about the Haskell-Cafe mailing list