Solution without compiler extensions:
Remove the type parameter ain both the class and the instance:
class QDS q where
instance QDS Queue where
and it compiles fine without language extensions.
A Need for MultiParamTypeClasses
The reason the compiler wants MultiParamTypeClassesit is obvious: yours QDSprovides two type parameters. If you did not include this instance, MultiParamTypeClass is enough.
The need for flexible operations
instance QDS Queue Int where . - , , a , Int.
?
a. , Functor, Foldable ..
, : , . . , ( , haskell).