File: Addr.hs

package info (click to toggle)
hugs 1.4.199801-1
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 7,220 kB
  • ctags: 5,609
  • sloc: ansic: 32,083; haskell: 12,143; yacc: 949; perl: 823; sh: 602; makefile: 236
file content (24 lines) | stat: -rw-r--r-- 681 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-----------------------------------------------------------------------------
-- Machine Addresses:
-- Suitable for use with Hugs 1.4 on 32 bit machines.
-----------------------------------------------------------------------------
module Addr
	( Addr
	, nullAddr -- :: Addr
 	, plusAddr -- :: Addr -> Int -> Addr
	-- instance Eq   Addr
	-- instance Show Addr
	) where

newtype Addr        = Addr Int deriving ( Eq )  -- not portable!

instance Show Addr where
  showsPrec p (Addr a) = showsPrec p a

nullAddr :: Addr
nullAddr = Addr 0

plusAddr :: Addr -> Int -> Addr
plusAddr (Addr a) o = Addr (a+o)

-----------------------------------------------------------------------------