talira

haskell-src-meta

Parse Haskell source to Template Haskell syntax

open sourceBSD-3-Clausefree

haskell-src-meta converts Haskell source parsed by haskell-src-exts into Template Haskell's abstract syntax, for use in splices and quasiquoters. It was written by Matt Morrow and is kept up to date with new Template Haskell versions by community maintainers in the haskell-party organisation; its translation isn't yet 100% complete.

Problems it solves

  • write a quasiquoter that embeds Haskell expressions
  • turn a string of Haskell code into a Template Haskell expression
  • parse Haskell syntax inside a Template Haskell splice

Features

  • haskell-src-exts AST to Template Haskell AST
  • for use in splices and quasiquoters

Limitations

  • The translation from haskell-src-exts syntax to Template Haskell syntax isn't complete.1

Alternatives

The same job

These do what haskell-src-meta does.

  1. th-lift Derive Template Haskell's Lift class for datatypes
  2. th-abstraction One interface to Template Haskell's datatype information across GHC versions

Compare haskell-src-meta with the top 3