ISC licensed
Maintained by Alexis King
This version can be pinned in stack with:th-to-exp-0.0.1.1@sha256:4b34d7bd923369faa7c37c6b85bd434f10354e75d63e8b31a9159b1f568d71ab,2028

Module documentation for 0.0.1.1

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.

Changes

0.0.1.1 (July 31st, 2017)

  • Added support for GHC 8.2.1 and template-haskell 2.12

0.0.1.0 (November 8th, 2016)

  • Initial release