T10598_TH.stderr 1.35 KB
Newer Older
Ryan Scott's avatar
Ryan Scott committed
1
T10598_TH.hs:(27,3)-(42,50): Splicing declarations
Alan Zimmerman's avatar
Alan Zimmerman committed
2 3 4 5 6 7 8 9 10 11 12 13 14
    do fooDataName <- newName "Foo"
       mkFooConName <- newName "MkFoo"
       let fooType = conT fooDataName
       sequence
         [newtypeD
            (cxt [])
            fooDataName
            []
            Nothing
            (normalC
               mkFooConName
               [bangType
                  (bang noSourceUnpackedness noSourceStrictness) [t| Int |]])
15 16 17
            [derivClause (Just StockStrategy) [[t| Eq |]],
             derivClause (Just AnyclassStrategy) [[t| C |]],
             derivClause (Just NewtypeStrategy) [[t| Read |]]],
Alan Zimmerman's avatar
Alan Zimmerman committed
18
          standaloneDerivWithStrategyD
19
            (Just StockStrategy)
Alan Zimmerman's avatar
Alan Zimmerman committed
20 21 22 23
            (cxt [])
            [t| Ord $(fooType) |]
            pending(rn) [<splice, fooType>],
          standaloneDerivWithStrategyD
24
            (Just AnyclassStrategy)
Alan Zimmerman's avatar
Alan Zimmerman committed
25 26 27 28
            (cxt [])
            [t| D $(fooType) |]
            pending(rn) [<splice, fooType>],
          standaloneDerivWithStrategyD
29
            (Just NewtypeStrategy)
Alan Zimmerman's avatar
Alan Zimmerman committed
30 31 32
            (cxt [])
            [t| Show $(fooType) |]
            pending(rn) [<splice, fooType>]]
Ryan Scott's avatar
Ryan Scott committed
33 34 35
  ======>
    newtype Foo
      = MkFoo Int
Alan Zimmerman's avatar
Alan Zimmerman committed
36 37 38 39 40 41
      deriving stock Eq
      deriving anyclass C
      deriving newtype Read
    deriving stock instance () => Ord Foo
    deriving anyclass instance () => D Foo
    deriving newtype instance () => Show Foo