Type checker loops with innocent looking associated type synonym

I've written this cute ;-) piece of code involving an associated type synonym, {-# OPTIONS_GHC -fglasgow-exts #-} class ZipWithA a where type Elem a :: * zipWithA :: [Elem a] -> a instance ZipWithA [a] where type Elem [a] = a zipWithA xs = xs instance ZipWithA b => ZipWithA ([a] -> b) where type Elem ([a] -> b) = a -> Elem b zipWithA fs = zipWithA . zipWith ($) fs and it behaves as intended: *Main> zipWithA [2, 3] :: [Int] [2,3] *Main> zipWithA [pred, succ] [2, 3] :: [Int] [1,4] *Main> zipWithA [(+), (-)] [2, 3] [5, 7] :: [Int] [7,-4] However, as soon as the overloading cannot be resolved, the type checker loops: *Main> zipWithA [head, last] ["more than", "haskell"] :: String "ml" *Main> zipWithA [head, last] ["more than", "haskell"] <<loops>> Just to be clear, I do not expect GHC to be able to type this last example, I would just have thought it would want to tell me in finite time that it cannot resolve the overloading here. Should I report this a bug? Or is it perhaps already been taken care of in the head? Or am I just plain unreasonable here? :-) Cheers, Stefan

Hello Stefan, Thursday, May 15, 2008, 5:46:57 PM, you wrote:
class ZipWithA a where type Elem a :: *
Should I report this a bug? Or is it perhaps already been taken care of in the head? Or am I just plain unreasonable here? :-)
afair, the rule of thumb is: please don't report us errors with type families in 6.8 - it's unofficial and incomplete here. test against HEAD if you are really interested -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Stefan Holdermans:
Should I report this a bug? Or is it perhaps already been taken care of in the head?
Probably the latter. But really as, Bulat wrote, type families in 6.8 are unsupported. Please test your code with a HEAD snapshot. If that goes wrong, a bug report on Trac would be most appreciated. Manuel

Manuel,
Should I report this a bug? Or is it perhaps already been taken care of in the head?
Probably the latter.
But really as, Bulat wrote, type families in 6.8 are unsupported. Please test your code with a HEAD snapshot. If that goes wrong, a bug report on Trac would be most appreciated.
Indeed: no problem with yesterday's HEAD. Thanks, Stefan
participants (3)
-
Bulat Ziganshin
-
Manuel M T Chakravarty
-
Stefan Holdermans