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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -