talira

Derive Template Haskell's Lift class for datatypes

open sourceGPL-2.0-only OR th-lift BSD 3-clause licencefree

th-lift derives Template Haskell's Lift class for Haskell datatypes using TemplateHaskell. Its own README says GHC's DeriveLift extension has largely taken over this job since GHC 8.0, so it's now mainly a way to bring later DeriveLift bug fixes to older GHC versions.

Problems it solves

  • derive Lift instances for my datatypes on an older GHC
  • get fixed DeriveLift behaviour on GHC versions that still have the bug
  • use a value of my own type inside a Template Haskell splice

Features

  • derives Lift instances for datatypes with Template Haskell
  • backports DeriveLift bug fixes to older GHC versions

Limitations

  • GHC's DeriveLift extension does the same job built in since GHC 8.0, which has largely replaced this package1
  • Only useful for projects that still support GHC versions older than the DeriveLift fixes they need1

Alternatives

The same job

These do what th-lift does.

  1. haskell-src-meta Parse Haskell source to Template Haskell syntax

Compare th-lift with the top 3