[Haskell] Wanted: tricks for conflicting instances

jeff p mutjida at gmail.com
Thu Jun 14 22:53:08 EDT 2007


Hello,

> Is it plausible to improve instance selection to use contexts?  I imagine
> doing so would require some kind of backtracking search.
>
Sometimes you can explicitly program instance selection by using type
level bools. Oleg has written several examples of this; here is one
which implements Prolog style proof-search:

    http://okmij.org/ftp/Haskell/types.html#de-typechecker

If you can implement IsFunctor and IsCofunctor as type level functions
(which might be very tedious or even impossible), then you could
re-implement Functor and Cofunctor with the desired functionality.

hth,
  Jeff


More information about the Haskell mailing list