projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1997-09-04 12:54:24 by simonm]
[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
(*) = undefined
8
negate = undefined
9
abs = undefined
10
signum = undefined
11
fromInteger = undefined
12
13
main = print (MkAge 3 + MkAge 5)