GHC | 10 Jul 2012 16:46
Favicon

#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]

#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)

GHC | 17 Jul 2012 09:45
Favicon

Re: #7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]

#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support)
[patch]
--------------------------------+-------------------------------------------
 Reporter:  mikhail.vorozhtsov  |          Owner:                  
     Type:  bug                 |         Status:  patch           
 Priority:  normal              |      Component:  Template Haskell
  Version:  7.5                 |       Keywords:                  
       Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown        |       Testcase:                  
Blockedby:                      |       Blocking:                  
  Related:                      |  
--------------------------------+-------------------------------------------
Changes (by mikhail.vorozhtsov):

  * status:  new => patch

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7064#comment:1>
GHC | 15 Aug 2012 15:49
Favicon

Re: #7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]

#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support)
[patch]
-----------------------------------+----------------------------------------
    Reporter:  mikhail.vorozhtsov  |       Owner:                  
        Type:  bug                 |      Status:  merge           
    Priority:  normal              |   Milestone:                  
   Component:  Template Haskell    |     Version:  7.5             
    Keywords:                      |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple    |     Failure:  None/Unknown    
  Difficulty:  Unknown             |    Testcase:                  
   Blockedby:                      |    Blocking:                  
     Related:                      |  
-----------------------------------+----------------------------------------
Changes (by simonpj):

  * status:  patch => merge
  * difficulty:  => Unknown

Comment:

 OK I've committed these to HEAD.

 Paolo can you merge to 7.6 please?  Relevant patches are these.

 Thanks for doing the work, Mikhail.

 GHC
 {{{
 commit 1993ee4ba8d30d6774c2330477a1eecf865dfa1f
 Author: Mikhail Vorozhtsov <mikhail.vorozhtsov <at> gmail.com>
(Continue reading)

GHC | 15 Aug 2012 19:28
Favicon

Re: #7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]

#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support)
[patch]
---------------------------------+------------------------------------------
  Reporter:  mikhail.vorozhtsov  |          Owner:                  
      Type:  bug                 |         Status:  closed          
  Priority:  normal              |      Milestone:  7.6.1           
 Component:  Template Haskell    |        Version:  7.5             
Resolution:  fixed               |       Keywords:                  
        Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown        |     Difficulty:  Unknown         
  Testcase:                      |      Blockedby:                  
  Blocking:                      |        Related:                  
---------------------------------+------------------------------------------
Changes (by pcapriotti):

  * status:  merge => closed
  * resolution:  => fixed
  * milestone:  => 7.6.1

Comment:

 Merged as 6d0e2f288a34f12f5e3228415351d5bb4280c814 and
 db0b4de55926b0bc98717c92ba543bcf9b89d024.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7064#comment:3>
GHC | 26 Oct 2012 12:27
Favicon

Re: #7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support) [patch]

#7064: TH: Pragmas refactoring (also adds RULES and 'SPECIALIZE instance' support)
[patch]
---------------------------------+------------------------------------------
  Reporter:  mikhail.vorozhtsov  |          Owner:                  
      Type:  bug                 |         Status:  closed          
  Priority:  normal              |      Milestone:  7.6.1           
 Component:  Template Haskell    |        Version:  7.5             
Resolution:  fixed               |       Keywords:                  
        Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown        |     Difficulty:  Unknown         
  Testcase:                      |      Blockedby:                  
  Blocking:                      |        Related:                  
---------------------------------+------------------------------------------

Comment(by simonpj):

 Actually we need this too
 {{{
 commit 5e54d55738d2144ab99e7b483bc4d237c1657251
 Author: Simon Peyton Jones <simonpj <at> microsoft.com>
 Date:   Fri Oct 19 00:48:41 2012 +0100

     Fix conversion of HsRule to TH syntax

     We weren't doing the binders right, and were creating NameLs
     rather than NameUs for the binders of the Rule.  That gave
     very funny output for T7064.

  compiler/deSugar/DsMeta.hs |  132
 ++++++++++++++++++++++----------------------
(Continue reading)


Gmane