7b685991d324952c6fedb2b5eddd55bf1bf7fec2
[ghc-hetmet.git] / ghc / tests / deriving / should_run / drvrun001.hs
1 -- Test newtype derived instances
2
3 newtype Age = MkAge Int deriving (Eq, Show)
4
5 instance Num Age where
6   (+) (MkAge a) (MkAge b) = MkAge (a+b)
7
8 main = print (MkAge 3 + MkAge 5)