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

[ library, template-haskell ] [ Propose Tags ] [ Report a vulnerability ]

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

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1.0, 0.0.1.1
Change log CHANGELOG.md
Dependencies base (>=4.9.0.0 && <5), template-haskell (>=2.11.0.0 && <2.13) [details]
License ISC
Author
Maintainer Alexis King
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 2017-07-31T18:01:03Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1750 total (2 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 2017-07-31 [all 1 reports]

Readme for th-to-exp-0.0.1.1

[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.