I am studying the type of family, but it is so confusing. When I define a polymorphic type outside the class definition, it works well.
{-
But when a polymorphic type is defined inside a class definition,
{-
then complier shows an error:
Illegal polymorphic or qualified type: forall a. Num a => a In the type instance declaration for 'T' In the instance declaration for 'AD'
Is there a way to make a function in a class whose return type is polymorphic, for example 3 (Num a => a)?
haskell
Mossid
source share