Hi, that's a bug in GHC---it erroneously accepts polymorphic instances which violate the FD of a class. -Iavor
On Fri, Mar 18, 2011 at 7:08 AM, Daniel Fischer < [email protected]> wrote: > On Friday 18 March 2011 14:40:40, JP Moresmau wrote: > > Thanks to you all, I think I understand better. > > instance Search Id Id where > > search _ _ i = only (FoundId i) > > > > Is too restrictive on the first type, so declaring instead: > > instance Search id Id where > > search _ _ i = only (FoundId i) > > Not sure what GHC does with that, but at least in spirit that violates the > FunDep of > > class Search id a | a -> id where ... > > Even if it works now, it may well not work in the future. > I'd go for a more stable solution respecting the intent of FunDeps > (i.e. there should only be one type t with an instance Search t Id). > > > > > Fixed the issue!! Now the initial "id" is not Id and everybody is > > happy (and the code still seems to work as intended) > > > > thanks again > > > > JP > > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
