New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow type variables to declared out of dependency order #131
base: master
Are you sure you want to change the base?
Conversation
What about It's not just implementation difficulty! Core, and Core types, are by design as simple and compositional as possible. I'm uncomfortable with having source language types that are notationally and behaviourally different. (Especially with higher rank and impredicative polymorphism.) I have not thought hard about this but the design here looks unattractive to me, even aside from the implementation consequences. |
There may be other places, too, where we make this distinction. I'm afraid I don't see the Haskell-level difficulty here. (I do easily see the Core-level difficulty!) Do you have another example you're unsure of? |
At least as a thought experiment, as far as I can tell, one way to implement this is by first implementing #99. Once you have that, this proposal can be implemented by e.g. desugaring typeRep :: forall (a :: k) k. Typeable a => TypeRep a to typeRep :: forall {k'} (a :: k') k. k ~ k' => Typeable a => TypeRep a Or, if as an extension to #99 you can also name type variables multiple times (semantics should be quite clear): typeRep :: forall {k} (a :: k) k. Typeable a => TypeRep a If that desugaring makes sense, and isn't exceedingly hard to implement (I haven't put much thought into it), then it's more a matter of what syntax to expose to the end user. The #99 syntax doesn't necessarily need to be exposed, even if it's used under the hood. |
Little activity recently, marking this as dormant. |
6b33e58
to
e7fdbc7
Compare
Rendered