Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Iavor Diatchki
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 < daniel.is.fisc...@googlemail.com> wrote: > On Friday 18 March 2011 14:40:40, JP Moresmau wrote: > > Thanks to you all, I think I underst

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Daniel Fischer
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)

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread JP Moresmau
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) Fixed the issue!! Now the initial "id" is not Id and everybody is

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Daniel Fischer
On Friday 18 March 2011 13:35:22, JP Moresmau wrote: > These are GHC types, but here is a self-contained example: > {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, > FlexibleInstances #-} > > data Id=Id String > > data Result id =ResultId Id > | ResultGen id > > data Sig id=IdSig

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Sean Leather
On Fri, Mar 18, 2011 at 13:35, JP Moresmau wrote: > These are GHC types, but here is a self-contained example: > {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, > FlexibleInstances #-} > > data Id=Id String > > data Result id =ResultId Id >| ResultGen id > > data Sig id=IdSig Id >

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread JP Moresmau
ge- > From: haskell-cafe-boun...@haskell.org > [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of JP Moresmau > Sent: 16 March 2011 21:46 > To: Haskell Cafe > Subject: [Haskell-cafe] Could not deduce ... using functional dependencies > with GHC7 > > Hello, when moving to GHC

Re: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-18 Thread Dimitrios Vytiniotis
ehalf Of JP Moresmau Sent: 16 March 2011 21:46 To: Haskell Cafe Subject: [Haskell-cafe] Could not deduce ... using functional dependencies with GHC7 Hello, when moving to GHC7 a body of code that I'm not immensely familiar with, I got an error compiling with GHC 7.0.2. Can somebody kindly exp

[Haskell-cafe] Could not deduce ... using functional dependencies with GHC7

2011-03-16 Thread JP Moresmau
Hello, when moving to GHC7 a body of code that I'm not immensely familiar with, I got an error compiling with GHC 7.0.2. Can somebody kindly explain to me what it means and how to get around it? This is in the scion code base so is using some GHC types. I have a class with a functional dependency