Proposal: Derive Lift for all data types in the template-haskell library

Ryan Scott ryan.gl.scott at gmail.com
Tue Sep 22 14:12:30 UTC 2015


The DeriveLift extension has landed in GHC HEAD, so now it's become
apparent that the bikeshed needs a new coat of paint. The only Lift
instances at the moment are base types [1], but with DeriveLift, it would
be possible to implement Lift for many for data types with ease.

I'll make (what I hope is) an uncontroversial first suggestion: we should
derive Lift for every data type in the template-haskell library itself.
These instances have proved to be useful for library authors who need to
convert to and from the TH AST (th-desugar, for example, relies on this
functionality via orphan instances [2]).

Adding this would break some code out in the wild (the th-lift [3] and
th-orphans [4] packages come to mind; there may be others), so I'll request
feedback before marching forth with this proposal.

Ryan S.

-----
[1]
http://hackage.haskell.org/package/template-haskell-2.10.0.0/docs/Language-Haskell-TH-Syntax.html#t:Lift
[2]
http://hackage.haskell.org/package/th-desugar-1.5.4.1/docs/src/Language-Haskell-TH-Desugar-Lift.html
[3] http://hackage.haskell.org/package/th-lift
[4] http://hackage.haskell.org/package/th-orphans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150922/c4e06774/attachment.html>


More information about the Libraries mailing list