inferred type doesn't type-check (using type families)
simonpj at microsoft.com
Wed Nov 4 03:29:26 EST 2009
| 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
But in this case all you've done is to make g have an ambiguous type.
I've drafted a FAQ about this at
Please, everyone, edit and extend.
More information about the Glasgow-haskell-users