diff options
Diffstat (limited to 'testsuite/tests/deriving/should_run/drvrun001.hs')
-rw-r--r-- | testsuite/tests/deriving/should_run/drvrun001.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_run/drvrun001.hs b/testsuite/tests/deriving/should_run/drvrun001.hs new file mode 100644 index 0000000000..b6bd259aa7 --- /dev/null +++ b/testsuite/tests/deriving/should_run/drvrun001.hs @@ -0,0 +1,13 @@ +-- Test newtype derived instances + +newtype Age = MkAge Int deriving (Eq, Show) + +instance Num Age where + (+) (MkAge a) (MkAge b) = MkAge (a+b) + (*) = undefined + negate = undefined + abs = undefined + signum = undefined + fromInteger = undefined + +main = print (MkAge 3 + MkAge 5) |