Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

Wildcard binders in type declarations
[GHC Proposal #425 "Invisible binders in type declarations"](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0425-decl-invis-binders.rst) defines the following grammar: ```haskell tv_bndr ::= | tyvar -- variable | '(' tyvar '::' kind ')' -- variable with kind annotation (NEW) | '@' tyvar -- invisible variable (NEW) | '@' '(' tyvar '::' kind ')' -- invisible variable with kind annotation (NEW) | '@' '_' -- wildcard (to skip an invisible quantifier) ``` This has been mostly implemented in 4aea0a72040e862ab518d911057905e8cf8d15fb, except for wildcard binders `@_`. Currently the user has to name all variables on the LHS, even if they are unused on the RHS: ```haskell type F :: forall a b. Proxy a -> Proxy b type F @a @b p = 'Proxy @b -- `a` and `p` are unused ``` But with the proposed invisible wildcard binder `@_`, the user could elide the name of `a`: ```diff - type F @a @b p = 'Proxy @b + type F @_ @b p = 'Proxy @b ``` I think it would also be fine to allow `_` binders without the `@`, even though this is not included in the proposal: ```diff - type F @a @b p = 'Proxy @b + type F @_ @b _ = 'Proxy @b ``` And possibly two more forms: visible and invisible wildcard binders with kind annotations: `@(_ :: k)` and `(_ :: k)`. All of those forms would arise naturally if we took the declaration of `HsTyVarBndr` and made the name field optional: ```diff data HsTyVarBndr flag pass = UserTyVar (XUserTyVar pass) flag - (LIdP pass) + (Maybe (LIdP pass)) | KindedTyVar (XKindedTyVar pass) flag - (LIdP pass) + (Maybe (LIdP pass)) (LHsKind pass) ``` Or it could be a dedicated data type instead of a general-purpose `Maybe`.
issue