<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I got a question about what the form of types in Haskell are allowed. Specifically, what are the requirements of the context of a type? The paper <br><br></div>    Typing Haskell in Haskell<br><br></div>required the type to be in the form P => t, where P to be in head-normal form or in other words shouldn't be something like Num Bool.<br><br></div><div>Now what about multi-parameter classes? The paper<br><br></div><div>    Type classes: an exploration of the design space<br><br></div><div>listed several potential choices but didn't say exactly what. <br><br></div><div>The Haskell 2010 report covered single-parameter type classes only. <br><br></div><div>Given the following definition.<br><br>class Collects ce e | ce -> e where<br>    empty :: ce<br>    insert :: e -> ce -> ce<br>    <br>insert2 c = insert True (insert False c)<br><br></div><div>The function insert2 has the following type<br><br>insert2 :: Collects ce Bool => ce -> ce<br><br></div><div>This shows that the definition of head-normal forms for multi-parameter class differs from that for single-parameter classes. Is there any definite specification about the context of Haskell types?<br><br></div><div>Thank you,<br></div><div>Sheng<br></div></div>