<div dir="ltr">Hi folks,<div><br></div><div>I know how to write existentially quantified data constructors for single-parameter type classes, but I'm having trouble doing it for multi-parameter type classes. Is it not possible, or am I just using the wrong syntax?</div><div><br></div><div>I have this class:</div><div><br></div><div><div>class Collidable a b where</div><div><span class="" style="white-space:pre">     </span>collideWith :: a -> b -> String</div></div><div><br></div><div>And I tried to define an existentially quantified data constructor thusly:</div><div><br></div><div><div>data Collision = forall a. (forall b. Collidable a b => Collision {collider1 :: a, collider2 :: b})</div></div><div><br></div><div>I get a parse error. So then I tried:</div><div><br></div><div><div>data Collision = forall a. forall b. Collidable a b => Collision {collider1 :: a, collider2 :: b}</div></div><div><br></div><div>I get a different parse error. Is there any way to make this work?</div><div><br></div><div>Thanks,</div><div>Lyle</div></div>