1 module PreludeBuiltin (
20 StateAndMallocPtr#(..),
22 StateAndMutableArray#(..),
23 StateAndByteArray#(..),
24 StateAndMutableByteArray#(..),
25 StateAndSynchVar#(..),
26 #ifndef __PARALLEL_HASKELL__
28 StateAndStablePtr#(..),
69 -- This follows the organisation of compiler/prelude/TysWiredIn.lhs
70 -- (which follows the state-interface.verb document).
73 -- instances are all done carefully, by hand (in the prelude/I*.hs files)
75 ----------------------------------------------------
81 data Float = F# Float#
82 data Double = D# Double#
84 data _State a = S# (State# a)
86 ----------------------------------------------------
88 -- Array is from PreludeArray & so can't be defined here.
89 -- _ByteArray, _MutableArray & _MutableByteArray are from PreludeGlaArray ...
91 data _MallocPtr = _MallocPtr MallocPtr#
92 #ifndef __PARALLEL_HASKELL__
93 data _StablePtr a = _StablePtr (StablePtr# a)
96 ----------------------------------------------------
98 data Integer = J# Int# Int# ByteArray#
99 -- corresponds to GNU multi-prec arith pkg rep
102 -- Oddly enough, the Return<blah>GMP<blah> don't need definitions,
103 -- because they are only used in "returning" (and so are never
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
109 data _Return2GMPs = _Return2GMPs Int# Int# ByteArray# Int# Int# ByteArray#
110 data _ReturnIntAndGMP = _ReturnIntAndGMP Int# Int# Int# ByteArray#
112 ----------------------------------------------------
114 data StateAndPtr# s elt = StateAndPtr# (State# s) elt
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#
123 #ifndef __PARALLEL_HASKELL__
124 data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
126 data StateAndMallocPtr# s = StateAndMallocPtr# (State# s) MallocPtr#
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)
133 data StateAndSynchVar# s elt = StateAndSynchVar# (State# s) (SynchVar# s elt)
135 ----------------------------------------------------
136 -- Bool: is from PreludeCore
138 data _CMP_TAG = _LT | _EQ | _GT -- for derived comparisons
140 ----------------------------------------------------
142 data List a = Nil | a : (List a)
143 {-# GENERATE_SPECS data a :: List a #-}
145 ----------------------------------------------------
148 data Tuple2 a b = Tup2 a b
149 data Tuple3 a b c = Tup3 a b c
150 data Tuple4 a b c d = Tup4 a b c d
151 data Tuple5 a b c d e = Tup5 a b c d e
152 data Tuple6 a b c d e f = Tup6 a b c d e f
153 data Tuple7 a b c d e f g = Tup7 a b c d e f g
154 data Tuple8 a b c d e f g h = Tup8 a b c d e f g h
155 data Tuple9 a b c d e f g h i = Tup9 a b c d e f g h i
156 data Tuple10 a b c d e f g h i j = Tup10 a b c d e f g h i j
157 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
158 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
159 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
160 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
161 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
162 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
163 data Tuple17 a b c d e f g h i j k l m n o p q
164 = Tup17 a b c d e f g h i j k l m n o p q
165 data Tuple18 a b c d e f g h i j k l m n o p q r
166 = Tup18 a b c d e f g h i j k l m n o p q r
167 data Tuple19 a b c d e f g h i j k l m n o p q r s
168 = Tup19 a b c d e f g h i j k l m n o p q r s
169 data Tuple20 a b c d e f g h i j k l m n o p q r s t
170 = Tup20 a b c d e f g h i j k l m n o p q r s t
171 data Tuple21 a b c d e f g h i j k l m n o p q r s t u
172 = Tup21 a b c d e f g h i j k l m n o p q r s t u
173 data Tuple22 a b c d e f g h i j k l m n o p q r s t u v
174 = Tup22 a b c d e f g h i j k l m n o p q r s t u v
175 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
176 = Tup23 a b c d e f g h i j k l m n o p q r s t u v w
177 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
178 = 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
179 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
180 = 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
181 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
182 = 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
183 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_
184 = 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_
185 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_
186 = 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_
187 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_
188 = 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_
189 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_
190 = 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_
191 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_
192 = 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_
193 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_
194 = 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_
196 {-# GENERATE_SPECS data a b :: Tuple2 a b #-}
197 {-# GENERATE_SPECS data a b c :: Tuple3 a b c #-}
198 {-# GENERATE_SPECS data a b c d :: Tuple4 a b c d #-}
200 {-# SPECIALIZE data Tuple5 Int# Int# Int# Int# Int# #-}
201 {-# SPECIALIZE data Tuple5 Char# Char# Char# Char# Char# #-}
202 {-# SPECIALIZE data Tuple5 Double# Double# Double# Double# Double# #-}
204 -- Check this out ... We need this for instance Floating Double# ...
206 {-# SPECIALIZE data Tuple19 a Double# b c d e f g h i j k l m n o p q r #-}
208 ----------------------------------------------------
209 -- Ratio: in PreludeRatio
211 data Bin = Bin_____________ -- placeholder only
213 -- IO things: in PreludeIO
215 data _Lift a = _Lift a
216 {-# GENERATE_SPECS data a :: _Lift a #-}