th-to-exp: Provides a way to persist data from compile-time to runtime.

[ library, template-haskell ] [ Propose Tags ]

This package provides a way to persist data from compile-time to runtime by producing Template Haskell expressions that evaluate to particular values. For example, if you have a value Just 1, then toExp (Just 1) will produce the expression [e| Just 1 |], which can be used in a splice. For a more direct example, here’s what that looks like without the quasiquote notation:

>>> toExp (Just 1)
AppE (ConE GHC.Base.Just) (LitE (IntegerL 1))

This is done by using a typeclass, ToExp, that can be automatically derived for types that have a Generic instance.


[Skip to Readme]

Modules

[Index]

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.0.1.0, 0.0.1.1
Dependencies base (>=4.9.0.0 && <5), template-haskell (>=2.11.0.0 && <2.12) [details]
License ISC
Author
Maintainer Alexis King
Revised Revision 1 made by lexi_lambda at 2017-07-31T17:29:07Z
Category Template Haskell
Home page https://github.com/lexi-lambda/th-to-exp#readme
Bug tracker https://github.com/lexi-lambda/th-to-exp/issues
Source repo head: git clone https://github.com/lexi-lambda/th-to-exp
Uploaded by lexi_lambda at 2016-11-08T00:23:25Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1694 total (8 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-11-17 [all 1 reports]

Readme for th-to-exp-0.0.1.0

[back to package description]

th-to-exp Build Status

th-to-exp is a package that provides a way to persist data from compile-time to runtime by producing Template Haskell expressions that evaluate to particular values. For example, if you have a value Just 1, then toExp (Just 1) will produce the expression [e| Just 1 |], which can be used in a splice. For a more direct example, here’s what that looks like without the quasiquote notation:

> toExp (Just 1)
AppE (ConE GHC.Base.Just) (LitE (IntegerL 1))

This is done by using a typeclass, ToExp, that can be automatically derived for types that have a Generic instance.