google / ghc-source-gen

Library for generating Haskell source files and code fragments.
BSD 3-Clause "New" or "Revised" License
91 stars 29 forks source link

Add `kindedVar` and take type parameters as `HsTyVarBndr`'. #61

Closed judah closed 4 years ago

judah commented 4 years ago

Previously functions like class' and data' took their type variables as OccNameStr which let them be passed as overloaded strings; for example, data' "Maybe" ["a"] .... Now, they take them as HsTyVarBndr', the same as forall', and can be constructed with, for example, data' "Maybe" [bvar "a"] ....

This approach lets them be constructed with either bvar (for regular variables) or kindedVar (for kind signatures).

Original patch by ersran9@.