[Template-haskell] Dec type is missing "NewType"

Andre Pang ozone@algorithm.com.au
Sun, 18 May 2003 00:14:16 +1000


Hi all, I think the Dec data type in THSyntax.hs (starting at line 174) 
is missing the "newtype" declaration.  It currently looks like this:

data Dec
   = Fun String [Clause]                 -- { f p1 p2 = b where decs }
   | Val Pat RightHandSide [Dec]         -- { p = b where decs }
   | Data Cxt String [String]
          [Con] [String]                 -- { data Cxt x => T x = A x | 
B (T x)  deriving (Z,W)}
   | TySyn String [String] Typ           -- { type T x = (x,x) }
   | Class Cxt String [String] [Dec]     -- { class Eq a => Ord a where 
ds }
   | Instance Cxt Typ [Dec]              -- { instance Show w => Show 
[w] where  ds }
   | Proto String Typ                    -- { length :: [a] -> Int }
   | Foreign Foreign
   deriving( Show )

Am I missing something, or is no way to write a newtype declaration?  I 
presume it's not the same as either a TySyn or Data.

Thanks once again,


-- 
% Andre Pang : trust.in.love.to.save