Using polymorphic type in type family in haskell -


i'm learning type family, it's confusing. when define polymorphic type outside of class definition, works well.

{-# language rank2types #-} type t = num => 

but when polymorphic type defined inside of class definition,

{-# language typefamilies #-} {-# language rank2types #-}  data d = d  class a     type t :: * instance d     type t d = num =>  

then complier shows error :

illegal polymorphic or qualified type: forall a. num => in type instance declaration 't' in instance declaration 'a d' 

is there way make function in class return type polymorphic, 3(num => a)?


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -