[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / lib / prelude / TysBasic.hs
1 module PreludeBuiltin (
2         Char(..),
3         Int(..),
4         _Word(..),
5         _Addr(..),
6         Float(..),
7         Double(..),
8         _State(..),
9         _MallocPtr(..),
10         Integer(..),
11         _Return2GMPs(..),
12         _ReturnIntAndGMP(..),
13         StateAndPtr#(..),
14         StateAndChar#(..),
15         StateAndInt#(..),
16         StateAndWord#(..),
17         StateAndFloat#(..),
18         StateAndDouble#(..),
19         StateAndAddr#(..),
20         StateAndMallocPtr#(..),
21         StateAndArray#(..),
22         StateAndMutableArray#(..),
23         StateAndByteArray#(..),
24         StateAndMutableByteArray#(..),
25         StateAndSynchVar#(..),
26 #ifndef __PARALLEL_HASKELL__
27         _StablePtr(..),
28         StateAndStablePtr#(..),
29 #endif
30         _CMP_TAG(..),
31         List(..),
32         Tuple0(..),
33         Tuple2(..),
34         Tuple3(..),
35         Tuple4(..),
36         Tuple5(..),
37         Tuple6(..),
38         Tuple7(..),
39         Tuple8(..),
40         Tuple9(..),
41         Tuple10(..),
42         Tuple11(..),
43         Tuple12(..),
44         Tuple13(..),
45         Tuple14(..),
46         Tuple15(..),
47         Tuple16(..),
48         Tuple17(..),
49         Tuple18(..),
50         Tuple19(..),
51         Tuple20(..),
52         Tuple21(..),
53         Tuple22(..),
54         Tuple23(..),
55         Tuple24(..),
56         Tuple25(..),
57         Tuple26(..),
58         Tuple27(..),
59         Tuple28(..),
60         Tuple29(..),
61         Tuple30(..),
62         Tuple31(..),
63         Tuple32(..),
64         Bin(..),
65         _Lift(..)
66     ) where
67
68 -- *********
69 -- This follows the organisation of compiler/prelude/TysWiredIn.lhs
70 -- (which follows the state-interface.verb document).
71 -- *********
72
73 -- instances are all done carefully, by hand (in the prelude/I*.hs files)
74
75 ----------------------------------------------------
76
77 data Char   = C# Char#
78 data Int    = I# Int#
79 data _Word  = W# Word#
80 data _Addr  = A# Addr#
81 data Float  = F# Float#
82 data Double = D# Double#
83
84 data _State a = S# (State# a)
85
86 ----------------------------------------------------
87
88 -- Array is from PreludeArray & so can't be defined here.
89 -- _ByteArray, _MutableArray & _MutableByteArray are from PreludeGlaArray ...
90
91 data _MallocPtr = _MallocPtr MallocPtr#
92 #ifndef __PARALLEL_HASKELL__
93 data _StablePtr a = _StablePtr (StablePtr# a)
94 #endif
95
96 ----------------------------------------------------
97
98 data Integer = J# Int# Int# ByteArray#
99         -- corresponds to GNU multi-prec arith pkg rep
100
101 -- Old:
102 --   Oddly enough, the Return<blah>GMP<blah> don't need definitions,
103 --   because they are only used in "returning" (and so are never
104 --   actually built).
105 -- New:
106 --   Unless you want to write your own code using the Integer primops
107 --   -- at which point it becomes essential to have these types. ADR
108
109 data _Return2GMPs = _Return2GMPs Int# Int# ByteArray# Int# Int# ByteArray#
110 data _ReturnIntAndGMP = _ReturnIntAndGMP Int# Int# Int# ByteArray#
111
112 ----------------------------------------------------
113
114 data StateAndPtr#    s elt = StateAndPtr#    (State# s) elt 
115
116 data StateAndChar#   s     = StateAndChar#   (State# s) Char# 
117 data StateAndInt#    s     = StateAndInt#    (State# s) Int# 
118 data StateAndWord#   s     = StateAndWord#   (State# s) Word#
119 data StateAndFloat#  s     = StateAndFloat#  (State# s) Float# 
120 data StateAndDouble# s     = StateAndDouble# (State# s) Double#  
121 data StateAndAddr#   s     = StateAndAddr#   (State# s) Addr#
122
123 #ifndef __PARALLEL_HASKELL__
124 data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
125 #endif
126 data StateAndMallocPtr# s   = StateAndMallocPtr# (State# s) MallocPtr#
127
128 data StateAndArray#            s elt = StateAndArray#        (State# s) (Array# elt) 
129 data StateAndMutableArray#     s elt = StateAndMutableArray# (State# s) (MutableArray# s elt)  
130 data StateAndByteArray#        s = StateAndByteArray#        (State# s) ByteArray# 
131 data StateAndMutableByteArray# s = StateAndMutableByteArray# (State# s) (MutableByteArray# s)
132
133 data StateAndSynchVar# s elt = StateAndSynchVar# (State# s) (SynchVar# s elt)
134
135 ----------------------------------------------------
136 -- Bool: is from PreludeCore
137
138 data _CMP_TAG = _LT | _EQ | _GT -- for derived comparisons
139
140 ----------------------------------------------------
141
142 data List a = Nil | a : (List a)
143
144 ----------------------------------------------------
145
146 data Tuple0                                  = Tup0
147 data Tuple2  a b                             = Tup2  a b
148 data Tuple3  a b c                           = Tup3  a b c
149 data Tuple4  a b c d                         = Tup4  a b c d
150 data Tuple5  a b c d e                       = Tup5  a b c d e
151 data Tuple6  a b c d e f                     = Tup6  a b c d e f
152 data Tuple7  a b c d e f g                   = Tup7  a b c d e f g
153 data Tuple8  a b c d e f g h                 = Tup8  a b c d e f g h
154 data Tuple9  a b c d e f g h i               = Tup9  a b c d e f g h i
155 data Tuple10 a b c d e f g h i j             = Tup10 a b c d e f g h i j
156 data Tuple11 a b c d e f g h i j k           = Tup11 a b c d e f g h i j k
157 data Tuple12 a b c d e f g h i j k l         = Tup12 a b c d e f g h i j k l
158 data Tuple13 a b c d e f g h i j k l m       = Tup13 a b c d e f g h i j k l m
159 data Tuple14 a b c d e f g h i j k l m n     = Tup14 a b c d e f g h i j k l m n
160 data Tuple15 a b c d e f g h i j k l m n o   = Tup15 a b c d e f g h i j k l m n o
161 data Tuple16 a b c d e f g h i j k l m n o p = Tup16 a b c d e f g h i j k l m n o p
162 data Tuple17 a b c d e f g h i j k l m n o p q
163  = Tup17 a b c d e f g h i j k l m n o p q
164 data Tuple18 a b c d e f g h i j k l m n o p q r
165  = Tup18 a b c d e f g h i j k l m n o p q r
166 data Tuple19 a b c d e f g h i j k l m n o p q r s
167  = Tup19 a b c d e f g h i j k l m n o p q r s
168 data Tuple20 a b c d e f g h i j k l m n o p q r s t
169  = Tup20 a b c d e f g h i j k l m n o p q r s t
170 data Tuple21 a b c d e f g h i j k l m n o p q r s t u
171  = Tup21 a b c d e f g h i j k l m n o p q r s t u
172 data Tuple22 a b c d e f g h i j k l m n o p q r s t u v
173  = Tup22 a b c d e f g h i j k l m n o p q r s t u v
174 data Tuple23 a b c d e f g h i j k l m n o p q r s t u v w
175  = Tup23 a b c d e f g h i j k l m n o p q r s t u v w
176 data Tuple24 a b c d e f g h i j k l m n o p q r s t u v w x
177  = Tup24 a b c d e f g h i j k l m n o p q r s t u v w x
178 data Tuple25 a b c d e f g h i j k l m n o p q r s t u v w x y
179  = Tup25 a b c d e f g h i j k l m n o p q r s t u v w x y
180 data Tuple26 a b c d e f g h i j k l m n o p q r s t u v w x y z
181  = Tup26 a b c d e f g h i j k l m n o p q r s t u v w x y z
182 data Tuple27 a b c d e f g h i j k l m n o p q r s t u v w x y z a_
183  = Tup27 a b c d e f g h i j k l m n o p q r s t u v w x y z a_
184 data Tuple28 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_
185  = Tup28 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_
186 data Tuple29 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_
187  = Tup29 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_
188 data Tuple30 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_
189  = Tup30 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_
190 data Tuple31 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_
191  = Tup31 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_
192 data Tuple32 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_
193  = Tup32 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_
194
195 ----------------------------------------------------
196 -- Ratio: in PreludeRatio
197
198 data Bin = Bin_____________ -- placeholder only
199
200 -- IO things: in PreludeIO
201
202 --{-# SPECIALIZE data _Lift (State# _RealWorld) #-}
203
204 data _Lift a = _Lift a