type and class problems compiling code on GHC 6.6

Dear Haskellers, I had used some code which worked fine on GHC 6.4 and now it dont compile on GHC 6.6. Can anyone please give me some workarounds and/or explanations about these 2 errors? instance InfoKind a b => InfoKind (Maybe a) b where blank = Nothing check n _ Nothing = ["No info value stored with "++n] check n g (Just a) = check n g a GHC complains that Illegal instance declaration for `InfoKind (Maybe a) b' (the Coverage Condition fails for one of the functional dependencies) In the instance declaration for `InfoKind (Maybe a) b' multiListViewGetTSelections :: MultiListView x () -> IO [x] multiListViewGetTSelections multiListView = do { Just ((model, _) :: (Var [x], x -> String)) <- unsafeObjectGetClientData multiListView ; -- more and more code } GHC complains that A pattern type signature cannot bind scoped type variables `x' unless the pattern has a rigid type context In the pattern: (model, _) :: (Var [x], x -> String) I would really appreciate some help. Best regards Miguel Vilaça

José Miguel Vilaça
I had used some code which worked fine on GHC 6.4 and now it dont compile on GHC 6.6.
I am unable to reproduce your problem. It is saddening that everyone neglects to provide self-contained code for others to reproduce the alleged problems. I have cooked up a small resemblance to demonstrate the lack of problems. It is accepted by GHC 6.6 just fine. It is self-contained, so you can reproduce the same success too.
instance InfoKind a b => InfoKind (Maybe a) b where [...]
{-# OPTIONS_GHC -fglasgow-exts #-} class InfoKind a b where info :: a -> b -> Bool instance InfoKind Int Double where info x y = fromIntegral x == y instance InfoKind a b => InfoKind (Maybe a) b where info Nothing y = False info (Just x) y = info x y testInfoKind = [ info (45::Int) (45::Double), info (Nothing::Maybe Int) (45::Double), info (Just 45::Maybe Int) (45::Double) ]
multiListViewGetTSelections :: MultiListView x () -> IO [x] multiListViewGetTSelections multiListView = do { Just ((model, _) :: (Var [x], x -> String)) <- unsafeObjectGetClientData multiListView [...]
{-# OPTIONS_GHC -fglasgow-exts #-} data Multi a = Multi (IO (Maybe ([a], a->String))) deMulti (Multi x) = x multiGetList :: Multi x -> IO [x] multiGetList m = do { Just ((list,_) :: ([x],x->String)) <- deMulti m ; return list }
participants (2)
-
Albert Lai
-
José Miguel Vilaça