| I think (untested) that in this particular case you can get around the
| problem using scoped type variables:
| 
| > g :: forall a. Num a => T a -> T a
| > g x = f x (42 :: a)
| 
| In fact, this seems to be the general pattern for fixing problems like
| this with type families: add extra "witness" arguments which GHC can
| use to unify type variables that are "hidden" inside type family
| applications.

But in this case all you've done is to make g have an ambiguous type.

I've drafted a FAQ about this at
        
http://haskell.org/haskellwiki/GHC/Type_families#Frequently_asked_questions

Please, everyone, edit and extend.

Simon
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to