https://github.com/konn/expandth
Expanding TemplateHaskell
https://github.com/konn/expandth
Last synced: 2 months ago
JSON representation
Expanding TemplateHaskell
- Host: GitHub
- URL: https://github.com/konn/expandth
- Owner: konn
- License: bsd-3-clause
- Created: 2015-08-22T17:40:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-24T17:58:27.000Z (over 9 years ago)
- Last Synced: 2025-01-23T17:23:09.572Z (4 months ago)
- Language: Haskell
- Size: 148 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
expandth - utility and library to expand Template Haskell macros
================================================================[](https://travis-ci.org/konn/expandth) [](https://hackage.haskell.org/package/expandth)
INSTALL
-------```zsh
$ git clone https://github.com/konn/expandth.git
$ cd expandth
$ stack install
```USAGE
-----```zsh
$ cat simple.hs
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Language.Haskell.THdo fun <- newName "hello"
sequence [sigD fun [t|String|], funD fun [clause [] (normalB [|"hay!"|]) []]]$ expandth simple.hs
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Language.Haskell.TH
import qualified GHC.Base
hello_0 :: GHC.Base.String
hello_0 = "hay!"
```TODO
----* Support QuasiQuotes
* Implement GHC version