10 Jul 2012 16:46
#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]
GHC <cvs-ghc <at> haskell.org>
2012-07-10 14:46:05 GMT
2012-07-10 14:46:05 GMT
#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support)
[patch]
--------------------------------+-------------------------------------------
Reporter: mikhail.vorozhtsov | Owner:
Type: bug | Status: new
Priority: normal | Component: Template Haskell
Version: 7.5 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
--------------------------------+-------------------------------------------
I noticed that currently there is not way to define "SPECIALIZE + phase"
pragma from TH, only "SPECIALIZE (NO)INLINE + phase". One thing led to
another, and I ended up refactoring the Pragma data type. Attached patches
* Allow "SPECIALIZE + phase" pragma
* Replace `Maybe (Bool, Int)` with something human-readable.
* Add RULES pragma support
* Add "SPECIALIZE instance" pragma support
* Modify pretty printing of pragmas to follow GHC ppr indentation more
closely.
Here is a little demo:
`HsToTh.hs`:
{{{
{-# LANGUAGE TemplateHaskell #-}
module HsToTh (decls, hsToTh) where
(Continue reading)
RSS Feed