The latest (2.8.0.0) definition for the Dec has the following instance constructor:
InstanceD Cxt Type [Dec]
Seems that only one type can be instantiated. Is there a way to work around this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, multi-parameter type classes are supported.
Somewhat confusingly, the
Typeargument refers to the entire instance head, and, even though it’s not really a type, it looks enough like one syntactically that the typeTypewas reused for this purpose.Therefore, if you’re generating a multi-parameter
instance Foo Int Bool, you need to use the “type”Foo Int Bool, constructed for example like this:Here’s a complete example: