[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / docs / libraries / Int.sgml
1 <sect> <idx/Int/
2 <label id="sec:Int">
3 <p>
4
5 This library provides signed integers of various sizes.  The types
6 supported are as follows:
7
8 <tabular ca="ll">
9 type    | number of bits @ 
10 <!-- <hline>  -->
11 Int8    | 8  @
12 Int16   | 16 @
13 Int32   | 32 @
14 Int64   | 64 @
15 <!-- <hline>  -->
16 </tabular>
17
18 For each type <it/I/ above, we provide the following instances.
19
20 <tscreen><verb>
21 data I            -- Signed Ints
22 iToInt            :: I -> Int  -- not provided for Int64
23 intToi            :: Int -> I  -- not provided for Int64
24 instance Eq       I
25 instance Ord      I
26 instance Show     I
27 instance Read     I
28 instance Bounded  I
29 instance Num      I
30 instance Real     I
31 instance Integral I
32 instance Enum     I
33 instance Ix       I
34 instance Bits     I
35 </verb></tscreen>
36 Plus
37 <tscreen><verb>
38 int8ToInt  :: Int8  -> Int
39 intToInt8  :: Int   -> Int8
40 int16ToInt :: Int16 -> Int
41 intToInt16 :: Int   -> Int16
42 int32ToInt :: Int32 -> Int
43 intToInt32 :: Int   -> Int32
44 </verb></tscreen>
45
46 <itemize>
47 <item>
48 Hugs does not provide <tt/Int64/ at the moment.
49
50 <item>
51 ToDo: complete the set of coercion functions.
52
53 </itemize>