<span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><div style="font-family: arial, sans-serif; font-size: 13px; ">Hi all,</div><div style="font-family: arial, sans-serif; font-size: 13px; "> I have played quite a bit with the ConstraintKinds extension, pretty cool.</div>
<div style="font-family: arial, sans-serif; font-size: 13px; "> But I found a problem which I thought would be made better, plz correct me if I am wrong</div><div style="font-family: arial, sans-serif; font-size: 13px; ">
</div><div style="font-family: arial, sans-serif; font-size: 13px; "> take a contrived example, </div><div style="font-family: arial, sans-serif; font-size: 13px; "> class C B => B a where </div><div style="font-family: arial, sans-serif; font-size: 13px; ">
here B :: * -> Constraint, I think this definition is reasonable, since B does not appears in the </div><div style="font-family: arial, sans-serif; font-size: 13px; "> first position of the context.</div><div style="font-family: arial, sans-serif; font-size: 13px; ">
</div><div style="font-family: arial, sans-serif; font-size: 13px; "> Previously, we require acyclic class declarations since we don't have ConstraintKinds extension</div><div style="font-family: arial, sans-serif; font-size: 13px; ">
but now since type class could be abstracted, I think the definition above should be ok.</div><div style="font-family: arial, sans-serif; font-size: 13px; "> </div><div style="font-family: arial, sans-serif; font-size: 13px; ">
the ghc-manual cited the program below is valid</div></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> </span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> class C a where {op :: D b => a -> b -> b}</span><div>
<span class="Apple-style-span" style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> class C a => D a where { ... }</span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><span style="font-family: sans-serif; background-color: rgb(255, 255, 255); "></span><div style="font-family: arial, sans-serif; font-size: 13px; ">
<span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "><font color="#333333"><br></font></span></div><div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "><font class="Apple-style-span" color="#333333"> </font> I think there are no reasons to reject </span></div>
<div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> class C B => B where (and this style is pretty useful in some cases)</span></div>
<div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> ...</span></div><div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> B :: * -> Constraint</span></div>
<div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> C :: (*->Constraint) -> Constraint</span></div><div style="font-family: arial, sans-serif; ">
<span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "><br></span></div><div style="font-family: arial, sans-serif; "><span style="font-family: monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255); "> Any comments are welcome</span></div>
</span><div><br></div>-- <br>Best, bob<br>
</div>