<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">I can agree that for a functional language, being able to apply any reasonable<br>
function to any reasonable matching argument has to be doable, but such a<br>
fundamental operation surely needs to be simple to describe?<br>
</blockquote></div><div><br></div><div>But it is already rather simple conceptually, it's just that Haskell's kind signature syntax makes it look hairy. I mean, if you squint enough, this:</div><div><br></div><div>($) :: forall (r :: RuntimeRep) (a :: *) (b :: TYPE r). (a -> b) -> a -> b</div><div><br></div><div>could be written like:</div><div><br></div><div>($) :: RuntimeRep r => (a :: TYPE Lifted) (b :: TYPE r). (a -> b) -> a -> b</div><div class="gmail_extra"><br></div><div class="gmail_extra">or like I've previously suggested (if * is the default kind and wildcards are allowed in kinds):</div><div class="gmail_extra"><br></div><div class="gmail_extra">($) :: forall a (b :: TYPE _). (a -> b) -> a -> b</div><div class="gmail_extra"><br></div><div class="gmail_extra"><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike>I mean, perhaps the syntax could be improved, but the information that:</div><div class="gmail_extra">* a is lifted and boxed</div><div class="gmail_extra">* b can have any kind that has a runtime representation (so unlifted and unboxed types are ok, but data kinds are not)</div><div class="gmail_extra">has to go somewhere if the ability to write levity-polymorphic functions is to be given to the user, rather than only available as a one-off hack in the compiler.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Perhaps going fully dependently typed and giving up on the distinction between values and types would change that; I'm not sure how for example Idris would handle levity polymorphism.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">Marcin Mrotek<br></div></div>