
On 20 May 2010 21:16, Evan Laforge
Someone recently described the HASP project, at http://hasp.cs.pdx.edu/. It describes "habit", a haskell like language with some additions and subtractions. There are a couple interesting extensions to 'instance' declarations:
-- explicitly declare that there is no instance, halting the compiler's search instance xyz fails
-- declares instances along with search order instance abc ... else def
The result is that if you put 'fails' at the end, you can make a closed typeclass. Presumably you could also make typeclasses open but only in a restricted way. Also presumably the compiler would then be able to make better decisions about overlapping instances and you could avoid a lot of overlapping problems.
Of course, it's just a paper with no compiler, so it's all "presumably" for the moment...
Hi Evan, hasn't EHC had something like this for a while with 'type class directives'?