Closed rrnewton closed 6 years ago
Good question. I believe that Type Application in GHC 8 meets this need well.
Var @ "x"
I think would be the right syntax. I will try to do an update of this example using this style at some point.
There is now an example of this: https://github.com/dorchard/effect-monad/blob/master/examples/ExtensibleState.hs
I think that the type application approach is preferable to adding Template Haskell (in terms of overhead) but it could make a nice option still as a module?
I.e. instead of:
Perhaps
$(var x)
at each use site ofx_var
?E.g. in this example.