You cannot use output with custom classes. Typically, deriving automatically generates code for the given methods of the class, which is possible only because the compiler knows what these methods should do, and thus can generate suitable implementations based on your type structure. This is clearly not possible for custom classes, since the compiler does not know how methods should behave.
In your case, it looks like you want to use standard implementations of one method that your class has, so the compiler should not generate an implementation. Of course, this means that deriving is not required at all, and you can simply use an instance declaration without a body.
PS: If you always want to use the standard implementation of the method, it may make sense not to use any class at all, but simply define myAnd as a function.
source share