lift-generics: GHC.Generics-based Language.Haskell.TH.Syntax.lift implementation

[ bsd3, language, library ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a GHC.Generics-based genericLift function (only available on GHC 7.4 and later), as well as a genericLiftWithPkgFallback function (for code that must support GHC 7.2 and earlier) and a genericLiftWithPkg function (for use when neither of the above will work), all of which can be used for providing a Language.Haskell.TH.Syntax.lift implementation. See the documentation in the Language.Haskell.TH.Lift.Generics module to get started.

Credit goes to Matthew Pickering for suggesting this idea.

Note that due to API limitations, GHC.Generics wasn't powerful enough to come up with the entirety of a lift implementation prior to GHC 8.0. For GHC 7.4 and later, we can pluck this information out of Typeable. For earlier versions, and where Typeable isn't available, genericLiftWithPkg requires you to produce the package name yourself, which proves to be no small feat (see the documentation for more info).

Luckily, you don't have to jump through as many hoops on GHC 7.4 and later: simply use the genericLift function, and life is good.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.1.3, 0.2, 0.2.1, 0.3
Change log CHANGELOG.md
Dependencies base (>=4.3 && <5), generic-deriving (>=1.9 && <2), ghc-prim, tagged (>=0.5 && <0.9), template-haskell (>=2.4 && <2.23), th-compat (>=0.1 && <0.2) [details]
Tested with ghc ==7.0.4, ghc ==7.2.2, ghc ==7.4.2, ghc ==7.6.3, ghc ==7.8.4, ghc ==7.10.3, ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.4, ghc ==9.0.1
License BSD-3-Clause
Copyright (C) 2015-2017 Ryan Scott
Author Ryan Scott
Maintainer Ryan Scott <ryan.gl.scott@gmail.com>
Revised Revision 7 made by ryanglscott at 2024-04-20T12:06:45Z
Category Language
Home page https://github.com/RyanGlScott/lift-generics
Bug tracker https://github.com/RyanGlScott/lift-generics/issues
Source repo head: git clone https://github.com/RyanGlScott/lift-generics
Uploaded by ryanglscott at 2021-09-16T12:03:56Z
Distributions LTSHaskell:0.2.1, NixOS:0.2.1, Stackage:0.3
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3767 total (50 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-09-16 [all 1 reports]

Readme for lift-generics-0.2.1

[back to package description]

lift-generics

Haskell Programming Language Hackage Dependencies Haskell Programming Language BSD3 License Build Status

This package provides a GHC.Generics-based genericLiftWithPkg function (intended for GHC 7.10 and earlier), as well as a genericLift function (only available on GHC 8.0 and later), both of which can be used for providing a Language.Haskell.TH.Syntax.lift implementation. See the documentation in the Language.Haskell.TH.Lift.Generics module to get started.

Credit goes to Matthew Pickering for suggesting this idea.

Note that due to API limitations, GHC.Generics wasn't powerful enough to come up with the entirety of a lift implementation prior to GHC 8.0. For this reason, genericLiftWithPkg requires you to produce the package name yourself, which proves to be no small feat (see the documentation for more info).

Luckily, you don't have to jump through as many hoops on GHC 8.0 and later: simply use the genericLift function, and life is good.