Skip to content

INLINE pragmas in instances declarations in quasiqutation are lost

Lets consider following code:

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies    #-}
module Derive where
import Language.Haskell.TH
import Text.Groom

noInlines = [d|
  data Unit = Unit    
  instance Show Unit where
    show _ = ""
    {-# INLINE show #-}
  |]

There is no INLINE pragma. But it's in place for declarations outside of instances

> putStrLn . groom =<< runQ mk
[DataD [] Unit_4 [] [NormalC Unit_5 []] [],
 InstanceD [] (AppT (ConT GHC.Show.Show) (ConT Unit_4))
   [FunD GHC.Show.show
      [Clause [WildP] (NormalB (LitE (StringL ""))) []]]]
Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information