11438838d9fd9fe311986a1679deb604b5b51f4a
[ghc.git] / libraries / ghc-prim / GHC / Classes.hs
1 {-# LANGUAGE CPP, Trustworthy #-}
2 {-# LANGUAGE NoImplicitPrelude, MagicHash, StandaloneDeriving, BangPatterns,
3 KindSignatures, DataKinds, ConstraintKinds,
4 MultiParamTypeClasses, FunctionalDependencies #-}
5 {-# LANGUAGE AllowAmbiguousTypes #-}
6 -- ip :: IP x a => a is strictly speaking ambiguous, but IP is magic
7 {-# LANGUAGE UndecidableSuperClasses #-}
8 -- Because of the type-variable superclasses for tuples
9
10 {-# OPTIONS_GHC -Wno-unused-imports #-}
11 -- -Wno-unused-imports needed for the GHC.Tuple import below. Sigh.
12
13 {-# OPTIONS_GHC -Wno-unused-top-binds #-}
14 -- -Wno-unused-top-binds is there (I hope) to stop Haddock complaining
15 -- about the constraint tuples being defined but not used
16
17 {-# OPTIONS_HADDOCK not-home #-}
18 -----------------------------------------------------------------------------
19 -- |
20 -- Module : GHC.Classes
21 -- Copyright : (c) The University of Glasgow, 1992-2002
22 -- License : see libraries/base/LICENSE
23 --
24 -- Maintainer : cvs-ghc@haskell.org
25 -- Stability : internal
26 -- Portability : non-portable (GHC extensions)
27 --
28 -- Basic classes.
29 --
30 -----------------------------------------------------------------------------
31
32 module GHC.Classes(
33 -- * Implicit paramaters
34 IP(..),
35
36 -- * Equality and ordering
37 Eq(..),
38 Ord(..),
39 -- ** Monomorphic equality operators
40 -- | See GHC.Classes#matching_overloaded_methods_in_rules
41 eqInt, neInt,
42 eqWord, neWord,
43 eqChar, neChar,
44 eqFloat, eqDouble,
45 -- ** Monomorphic comparison operators
46 gtInt, geInt, leInt, ltInt, compareInt, compareInt#,
47 gtWord, geWord, leWord, ltWord, compareWord, compareWord#,
48
49 -- * Functions over Bool
50 (&&), (||), not,
51
52 -- * Integer arithmetic
53 divInt#, modInt#
54 ) where
55
56 -- GHC.Magic is used in some derived instances
57 import GHC.Magic ()
58 import GHC.IntWord64
59 import GHC.Prim
60 import GHC.Tuple
61 import GHC.CString (unpackCString#)
62 import GHC.Types
63
64 #include "MachDeps.h"
65
66 infix 4 ==, /=, <, <=, >=, >
67 infixr 3 &&
68 infixr 2 ||
69
70 default () -- Double isn't available yet
71
72 -- | The syntax @?x :: a@ is desugared into @IP "x" a@
73 -- IP is declared very early, so that libraries can take
74 -- advantage of the implicit-call-stack feature
75 class IP (x :: Symbol) a | x -> a where
76 ip :: a
77
78 {- $matching_overloaded_methods_in_rules
79
80 Matching on class methods (e.g. @(==)@) in rewrite rules tends to be a bit
81 fragile. For instance, consider this motivating example from the @bytestring@
82 library,
83
84 > break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString)
85 > breakByte :: Word8 -> ByteString -> (ByteString, ByteString)
86 > {-# RULES "break -> breakByte" forall a. break (== x) = breakByte x #-}
87
88 Here we have two functions, with @breakByte@ providing an optimized
89 implementation of @break@ where the predicate is merely testing for equality
90 with a known @Word8@. As written, however, this rule will be quite fragile as
91 the @(==)@ class operation rule may rewrite the predicate before our @break@
92 rule has a chance to fire.
93
94 For this reason, most of the primitive types in @base@ have 'Eq' and 'Ord'
95 instances defined in terms of helper functions with inlinings delayed to phase
96 1. For instance, @Word8@\'s @Eq@ instance looks like,
97
98 > instance Eq Word8 where
99 > (==) = eqWord8
100 > (/=) = neWord8
101 >
102 > eqWord8, neWord8 :: Word8 -> Word8 -> Bool
103 > eqWord8 (W8# x) (W8# y) = ...
104 > neWord8 (W8# x) (W8# y) = ...
105 > {-# INLINE [1] eqWord8 #-}
106 > {-# INLINE [1] neWord8 #-}
107
108 This allows us to save our @break@ rule above by rewriting it to instead match
109 against @eqWord8@,
110
111 > {-# RULES "break -> breakByte" forall a. break (`eqWord8` x) = breakByte x #-}
112
113 Currently this is only done for '(==)', '(/=)', '(<)', '(<=)', '(>)', and '(>=)'
114 for the types in "GHC.Word" and "GHC.Int".
115 -}
116
117 -- | The 'Eq' class defines equality ('==') and inequality ('/=').
118 -- All the basic datatypes exported by the "Prelude" are instances of 'Eq',
119 -- and 'Eq' may be derived for any datatype whose constituents are also
120 -- instances of 'Eq'.
121 --
122 -- The Haskell Report defines no laws for 'Eq'. However, '==' is customarily
123 -- expected to implement an equivalence relationship where two values comparing
124 -- equal are indistinguishable by "public" functions, with a "public" function
125 -- being one not allowing to see implementation details. For example, for a
126 -- type representing non-normalised natural numbers modulo 100, a "public"
127 -- function doesn't make the difference between 1 and 201. It is expected to
128 -- have the following properties:
129 --
130 -- [__Reflexivity__]: @x == x@ = 'True'
131 -- [__Symmetry__]: @x == y@ = @y == x@
132 -- [__Transitivity__]: if @x == y && y == z@ = 'True', then @x == z@ = 'True'
133 -- [__Substitutivity__]: if @x == y@ = 'True' and @f@ is a "public" function
134 -- whose return type is an instance of 'Eq', then @f x == f y@ = 'True'
135 -- [__Negation__]: @x /= y@ = @not (x == y)@
136 --
137 -- Minimal complete definition: either '==' or '/='.
138 --
139 class Eq a where
140 (==), (/=) :: a -> a -> Bool
141
142 {-# INLINE (/=) #-}
143 {-# INLINE (==) #-}
144 x /= y = not (x == y)
145 x == y = not (x /= y)
146 {-# MINIMAL (==) | (/=) #-}
147
148 deriving instance Eq ()
149 deriving instance (Eq a, Eq b) => Eq (a, b)
150 deriving instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
151 deriving instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
152 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
153 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f)
154 => Eq (a, b, c, d, e, f)
155 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g)
156 => Eq (a, b, c, d, e, f, g)
157 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
158 Eq h)
159 => Eq (a, b, c, d, e, f, g, h)
160 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
161 Eq h, Eq i)
162 => Eq (a, b, c, d, e, f, g, h, i)
163 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
164 Eq h, Eq i, Eq j)
165 => Eq (a, b, c, d, e, f, g, h, i, j)
166 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
167 Eq h, Eq i, Eq j, Eq k)
168 => Eq (a, b, c, d, e, f, g, h, i, j, k)
169 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
170 Eq h, Eq i, Eq j, Eq k, Eq l)
171 => Eq (a, b, c, d, e, f, g, h, i, j, k, l)
172 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
173 Eq h, Eq i, Eq j, Eq k, Eq l, Eq m)
174 => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)
175 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
176 Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n)
177 => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
178 deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
179 Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o)
180 => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
181
182 instance (Eq a) => Eq [a] where
183 {-# SPECIALISE instance Eq [[Char]] #-}
184 {-# SPECIALISE instance Eq [Char] #-}
185 {-# SPECIALISE instance Eq [Int] #-}
186 [] == [] = True
187 (x:xs) == (y:ys) = x == y && xs == ys
188 _xs == _ys = False
189
190 deriving instance Eq Module
191
192 instance Eq TrName where
193 TrNameS a == TrNameS b = isTrue# (a `eqAddr#` b)
194 a == b = toString a == toString b
195 where
196 toString (TrNameS s) = unpackCString# s
197 toString (TrNameD s) = s
198
199 deriving instance Eq Bool
200 deriving instance Eq Ordering
201
202 instance Eq Word where
203 (==) = eqWord
204 (/=) = neWord
205
206 -- See GHC.Classes#matching_overloaded_methods_in_rules
207 {-# INLINE [1] eqWord #-}
208 {-# INLINE [1] neWord #-}
209 eqWord, neWord :: Word -> Word -> Bool
210 (W# x) `eqWord` (W# y) = isTrue# (x `eqWord#` y)
211 (W# x) `neWord` (W# y) = isTrue# (x `neWord#` y)
212
213 -- See GHC.Classes#matching_overloaded_methods_in_rules
214 instance Eq Char where
215 (==) = eqChar
216 (/=) = neChar
217
218 -- See GHC.Classes#matching_overloaded_methods_in_rules
219 {-# INLINE [1] eqChar #-}
220 {-# INLINE [1] neChar #-}
221 eqChar, neChar :: Char -> Char -> Bool
222 (C# x) `eqChar` (C# y) = isTrue# (x `eqChar#` y)
223 (C# x) `neChar` (C# y) = isTrue# (x `neChar#` y)
224
225 -- | Note that due to the presence of @NaN@, `Float`'s 'Eq' instance does not
226 -- satisfy reflexivity.
227 --
228 -- >>> 0/0 == (0/0 :: Float)
229 -- False
230 --
231 -- Also note that `Float`'s 'Eq' instance does not satisfy substitutivity:
232 --
233 -- >>> 0 == (-0 :: Float)
234 -- True
235 -- >>> recip 0 == recip (-0 :: Float)
236 -- False
237 instance Eq Float where
238 (==) = eqFloat
239
240 -- See GHC.Classes#matching_overloaded_methods_in_rules
241 {-# INLINE [1] eqFloat #-}
242 eqFloat :: Float -> Float -> Bool
243 (F# x) `eqFloat` (F# y) = isTrue# (x `eqFloat#` y)
244
245 -- | Note that due to the presence of @NaN@, `Double`'s 'Eq' instance does not
246 -- satisfy reflexivity.
247 --
248 -- >>> 0/0 == (0/0 :: Double)
249 -- False
250 --
251 -- Also note that `Double`'s 'Eq' instance does not satisfy substitutivity:
252 --
253 -- >>> 0 == (-0 :: Double)
254 -- True
255 -- >>> recip 0 == recip (-0 :: Double)
256 -- False
257 instance Eq Double where
258 (==) = eqDouble
259
260 -- See GHC.Classes#matching_overloaded_methods_in_rules
261 {-# INLINE [1] eqDouble #-}
262 eqDouble :: Double -> Double -> Bool
263 (D# x) `eqDouble` (D# y) = isTrue# (x ==## y)
264
265 instance Eq Int where
266 (==) = eqInt
267 (/=) = neInt
268
269 -- See GHC.Classes#matching_overloaded_methods_in_rules
270 {-# INLINE [1] eqInt #-}
271 {-# INLINE [1] neInt #-}
272 eqInt, neInt :: Int -> Int -> Bool
273 (I# x) `eqInt` (I# y) = isTrue# (x ==# y)
274 (I# x) `neInt` (I# y) = isTrue# (x /=# y)
275
276 #if WORD_SIZE_IN_BITS < 64
277 instance Eq TyCon where
278 (==) (TyCon hi1 lo1 _ _ _ _) (TyCon hi2 lo2 _ _ _ _)
279 = isTrue# (hi1 `eqWord64#` hi2) && isTrue# (lo1 `eqWord64#` lo2)
280 instance Ord TyCon where
281 compare (TyCon hi1 lo1 _ _ _ _) (TyCon hi2 lo2 _ _ _ _)
282 | isTrue# (hi1 `gtWord64#` hi2) = GT
283 | isTrue# (hi1 `ltWord64#` hi2) = LT
284 | isTrue# (lo1 `gtWord64#` lo2) = GT
285 | isTrue# (lo1 `ltWord64#` lo2) = LT
286 | True = EQ
287 #else
288 instance Eq TyCon where
289 (==) (TyCon hi1 lo1 _ _ _ _) (TyCon hi2 lo2 _ _ _ _)
290 = isTrue# (hi1 `eqWord#` hi2) && isTrue# (lo1 `eqWord#` lo2)
291 instance Ord TyCon where
292 compare (TyCon hi1 lo1 _ _ _ _) (TyCon hi2 lo2 _ _ _ _)
293 | isTrue# (hi1 `gtWord#` hi2) = GT
294 | isTrue# (hi1 `ltWord#` hi2) = LT
295 | isTrue# (lo1 `gtWord#` lo2) = GT
296 | isTrue# (lo1 `ltWord#` lo2) = LT
297 | True = EQ
298 #endif
299
300
301 -- | The 'Ord' class is used for totally ordered datatypes.
302 --
303 -- Instances of 'Ord' can be derived for any user-defined datatype whose
304 -- constituent types are in 'Ord'. The declared order of the constructors in
305 -- the data declaration determines the ordering in derived 'Ord' instances. The
306 -- 'Ordering' datatype allows a single comparison to determine the precise
307 -- ordering of two objects.
308 --
309 -- The Haskell Report defines no laws for 'Ord'. However, '<=' is customarily
310 -- expected to implement a non-strict partial order and have the following
311 -- properties:
312 --
313 -- [__Transitivity__]: if @x <= y && y <= z@ = 'True', then @x <= z@ = 'True'
314 -- [__Reflexivity__]: @x <= x@ = 'True'
315 -- [__Antisymmetry__]: if @x <= y && y <= x@ = 'True', then @x == y@ = 'True'
316 --
317 -- Note that the following operator interactions are expected to hold:
318 --
319 -- 1. @x >= y@ = @y <= x@
320 -- 2. @x < y@ = @x <= y && x /= y@
321 -- 3. @x > y@ = @y < x@
322 -- 4. @x < y@ = @compare x y == LT@
323 -- 5. @x > y@ = @compare x y == GT@
324 -- 6. @x == y@ = @compare x y == EQ@
325 -- 7. @min x y == if x <= y then x else y@ = 'True'
326 -- 8. @max x y == if x >= y then x else y@ = 'True'
327 --
328 -- Minimal complete definition: either 'compare' or '<='.
329 -- Using 'compare' can be more efficient for complex types.
330 --
331 class (Eq a) => Ord a where
332 compare :: a -> a -> Ordering
333 (<), (<=), (>), (>=) :: a -> a -> Bool
334 max, min :: a -> a -> a
335
336 compare x y = if x == y then EQ
337 -- NB: must be '<=' not '<' to validate the
338 -- above claim about the minimal things that
339 -- can be defined for an instance of Ord:
340 else if x <= y then LT
341 else GT
342
343 x < y = case compare x y of { LT -> True; _ -> False }
344 x <= y = case compare x y of { GT -> False; _ -> True }
345 x > y = case compare x y of { GT -> True; _ -> False }
346 x >= y = case compare x y of { LT -> False; _ -> True }
347
348 -- These two default methods use '<=' rather than 'compare'
349 -- because the latter is often more expensive
350 max x y = if x <= y then y else x
351 min x y = if x <= y then x else y
352 {-# MINIMAL compare | (<=) #-}
353
354 deriving instance Ord ()
355 deriving instance (Ord a, Ord b) => Ord (a, b)
356 deriving instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
357 deriving instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
358 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
359 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f)
360 => Ord (a, b, c, d, e, f)
361 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g)
362 => Ord (a, b, c, d, e, f, g)
363 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
364 Ord h)
365 => Ord (a, b, c, d, e, f, g, h)
366 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
367 Ord h, Ord i)
368 => Ord (a, b, c, d, e, f, g, h, i)
369 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
370 Ord h, Ord i, Ord j)
371 => Ord (a, b, c, d, e, f, g, h, i, j)
372 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
373 Ord h, Ord i, Ord j, Ord k)
374 => Ord (a, b, c, d, e, f, g, h, i, j, k)
375 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
376 Ord h, Ord i, Ord j, Ord k, Ord l)
377 => Ord (a, b, c, d, e, f, g, h, i, j, k, l)
378 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
379 Ord h, Ord i, Ord j, Ord k, Ord l, Ord m)
380 => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)
381 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
382 Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n)
383 => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
384 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
385 Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o)
386 => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
387
388 instance (Ord a) => Ord [a] where
389 {-# SPECIALISE instance Ord [[Char]] #-}
390 {-# SPECIALISE instance Ord [Char] #-}
391 {-# SPECIALISE instance Ord [Int] #-}
392 compare [] [] = EQ
393 compare [] (_:_) = LT
394 compare (_:_) [] = GT
395 compare (x:xs) (y:ys) = case compare x y of
396 EQ -> compare xs ys
397 other -> other
398
399 deriving instance Ord Bool
400 deriving instance Ord Ordering
401
402 -- We don't use deriving for Ord Char, because for Ord the derived
403 -- instance defines only compare, which takes two primops. Then
404 -- '>' uses compare, and therefore takes two primops instead of one.
405 instance Ord Char where
406 (C# c1) > (C# c2) = isTrue# (c1 `gtChar#` c2)
407 (C# c1) >= (C# c2) = isTrue# (c1 `geChar#` c2)
408 (C# c1) <= (C# c2) = isTrue# (c1 `leChar#` c2)
409 (C# c1) < (C# c2) = isTrue# (c1 `ltChar#` c2)
410
411 -- | Note that due to the presence of @NaN@, `Float`'s 'Ord' instance does not
412 -- satisfy reflexivity.
413 --
414 -- >>> 0/0 <= (0/0 :: Float)
415 -- False
416 --
417 -- Also note that, due to the same, `Ord`'s operator interactions are not
418 -- respected by `Float`'s instance:
419 --
420 -- >>> (0/0 :: Float) > 1
421 -- False
422 -- >>> compare (0/0 :: Float) 1
423 -- GT
424 instance Ord Float where
425 (F# x) `compare` (F# y)
426 = if isTrue# (x `ltFloat#` y) then LT
427 else if isTrue# (x `eqFloat#` y) then EQ
428 else GT
429
430 (F# x) < (F# y) = isTrue# (x `ltFloat#` y)
431 (F# x) <= (F# y) = isTrue# (x `leFloat#` y)
432 (F# x) >= (F# y) = isTrue# (x `geFloat#` y)
433 (F# x) > (F# y) = isTrue# (x `gtFloat#` y)
434
435 -- | Note that due to the presence of @NaN@, `Double`'s 'Ord' instance does not
436 -- satisfy reflexivity.
437 --
438 -- >>> 0/0 <= (0/0 :: Double)
439 -- False
440 --
441 -- Also note that, due to the same, `Ord`'s operator interactions are not
442 -- respected by `Double`'s instance:
443 --
444 -- >>> (0/0 :: Double) > 1
445 -- False
446 -- >>> compare (0/0 :: Double) 1
447 -- GT
448 instance Ord Double where
449 (D# x) `compare` (D# y)
450 = if isTrue# (x <## y) then LT
451 else if isTrue# (x ==## y) then EQ
452 else GT
453
454 (D# x) < (D# y) = isTrue# (x <## y)
455 (D# x) <= (D# y) = isTrue# (x <=## y)
456 (D# x) >= (D# y) = isTrue# (x >=## y)
457 (D# x) > (D# y) = isTrue# (x >## y)
458
459 instance Ord Int where
460 compare = compareInt
461 (<) = ltInt
462 (<=) = leInt
463 (>=) = geInt
464 (>) = gtInt
465
466 -- See GHC.Classes#matching_overloaded_methods_in_rules
467 {-# INLINE [1] gtInt #-}
468 {-# INLINE [1] geInt #-}
469 {-# INLINE [1] ltInt #-}
470 {-# INLINE [1] leInt #-}
471 gtInt, geInt, ltInt, leInt :: Int -> Int -> Bool
472 (I# x) `gtInt` (I# y) = isTrue# (x ># y)
473 (I# x) `geInt` (I# y) = isTrue# (x >=# y)
474 (I# x) `ltInt` (I# y) = isTrue# (x <# y)
475 (I# x) `leInt` (I# y) = isTrue# (x <=# y)
476
477 compareInt :: Int -> Int -> Ordering
478 (I# x#) `compareInt` (I# y#) = compareInt# x# y#
479
480 compareInt# :: Int# -> Int# -> Ordering
481 compareInt# x# y#
482 | isTrue# (x# <# y#) = LT
483 | isTrue# (x# ==# y#) = EQ
484 | True = GT
485
486 instance Ord Word where
487 compare = compareWord
488 (<) = ltWord
489 (<=) = leWord
490 (>=) = geWord
491 (>) = gtWord
492
493 -- See GHC.Classes#matching_overloaded_methods_in_rules
494 {-# INLINE [1] gtWord #-}
495 {-# INLINE [1] geWord #-}
496 {-# INLINE [1] ltWord #-}
497 {-# INLINE [1] leWord #-}
498 gtWord, geWord, ltWord, leWord :: Word -> Word -> Bool
499 (W# x) `gtWord` (W# y) = isTrue# (x `gtWord#` y)
500 (W# x) `geWord` (W# y) = isTrue# (x `geWord#` y)
501 (W# x) `ltWord` (W# y) = isTrue# (x `ltWord#` y)
502 (W# x) `leWord` (W# y) = isTrue# (x `leWord#` y)
503
504 compareWord :: Word -> Word -> Ordering
505 (W# x#) `compareWord` (W# y#) = compareWord# x# y#
506
507 compareWord# :: Word# -> Word# -> Ordering
508 compareWord# x# y#
509 | isTrue# (x# `ltWord#` y#) = LT
510 | isTrue# (x# `eqWord#` y#) = EQ
511 | True = GT
512
513 -- OK, so they're technically not part of a class...:
514
515 -- Boolean functions
516
517 -- | Boolean \"and\"
518 (&&) :: Bool -> Bool -> Bool
519 True && x = x
520 False && _ = False
521
522 -- | Boolean \"or\"
523 (||) :: Bool -> Bool -> Bool
524 True || _ = True
525 False || x = x
526
527 -- | Boolean \"not\"
528 not :: Bool -> Bool
529 not True = False
530 not False = True
531
532
533 ------------------------------------------------------------------------
534 -- These don't really belong here, but we don't have a better place to
535 -- put them
536
537 -- These functions have built-in rules.
538 {-# NOINLINE [0] divInt# #-}
539 {-# NOINLINE [0] modInt# #-}
540 divInt# :: Int# -> Int# -> Int#
541 x# `divInt#` y#
542 -- Be careful NOT to overflow if we do any additional arithmetic
543 -- on the arguments... the following previous version of this
544 -- code has problems with overflow:
545 -- | (x# ># 0#) && (y# <# 0#) = ((x# -# y#) -# 1#) `quotInt#` y#
546 -- | (x# <# 0#) && (y# ># 0#) = ((x# -# y#) +# 1#) `quotInt#` y#
547 = if isTrue# (x# ># 0#) && isTrue# (y# <# 0#) then ((x# -# 1#) `quotInt#` y#) -# 1#
548 else if isTrue# (x# <# 0#) && isTrue# (y# ># 0#) then ((x# +# 1#) `quotInt#` y#) -# 1#
549 else x# `quotInt#` y#
550
551 modInt# :: Int# -> Int# -> Int#
552 x# `modInt#` y#
553 = if isTrue# (x# ># 0#) && isTrue# (y# <# 0#) ||
554 isTrue# (x# <# 0#) && isTrue# (y# ># 0#)
555 then if isTrue# (r# /=# 0#) then r# +# y# else 0#
556 else r#
557 where
558 !r# = x# `remInt#` y#
559
560
561 {- *************************************************************
562 * *
563 * Constraint tuples *
564 * *
565 ************************************************************* -}
566
567 class ()
568 class (c1, c2) => (c1, c2)
569 class (c1, c2, c3) => (c1, c2, c3)
570 class (c1, c2, c3, c4) => (c1, c2, c3, c4)
571 class (c1, c2, c3, c4, c5) => (c1, c2, c3, c4, c5)
572 class (c1, c2, c3, c4, c5, c6) => (c1, c2, c3, c4, c5, c6)
573 class (c1, c2, c3, c4, c5, c6, c7) => (c1, c2, c3, c4, c5, c6, c7)
574 class (c1, c2, c3, c4, c5, c6, c7, c8) => (c1, c2, c3, c4, c5, c6, c7, c8)
575 class (c1, c2, c3, c4, c5, c6, c7, c8, c9)
576 => (c1, c2, c3, c4, c5, c6, c7, c8, c9)
577 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10)
578 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10)
579 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11)
580 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11)
581 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12)
582 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12)
583 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13)
584 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13)
585 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14)
586 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14)
587 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15)
588 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15)
589 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16)
590 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16)
591 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
592 c17)
593 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
594 c17)
595 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
596 c17,c18)
597 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
598 c17, c18)
599 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
600 c17, c18, c19)
601 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
602 c17, c18, c19)
603 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
604 c17, c18, c19, c20)
605 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
606 c17, c18, c19, c20)
607 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
608 c17, c18, c19, c20, c21)
609 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
610 c17, c18, c19, c20, c21)
611 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
612 c17, c18, c19, c20, c21, c22)
613 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
614 c17, c18, c19, c20, c21, c22)
615 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
616 c17, c18, c19, c20, c21, c22, c23)
617 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
618 c17, c18, c19, c20, c21, c22, c23)
619 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
620 c17, c18, c19, c20, c21, c22, c23, c24)
621 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
622 c17, c18, c19, c20, c21, c22, c23, c24)
623 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
624 c17, c18, c19, c20, c21, c22, c23, c24, c25)
625 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
626 c17, c18, c19, c20, c21, c22, c23, c24, c25)
627 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
628 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26)
629 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
630 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26)
631 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
632 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27)
633 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
634 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27)
635 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
636 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28)
637 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
638 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28)
639 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
640 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29)
641 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
642 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29)
643 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
644 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30)
645 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
646 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30)
647 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
648 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
649 c31)
650 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
651 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
652 c31)
653 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
654 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
655 c31, c32)
656 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
657 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
658 c31, c32)
659 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
660 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
661 c31, c32, c33)
662 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
663 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
664 c31, c32, c33)
665 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
666 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
667 c31, c32, c33, c34)
668 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
669 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
670 c31, c32, c33, c34)
671 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
672 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
673 c31, c32, c33, c34, c35)
674 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
675 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
676 c31, c32, c33, c34, c35)
677 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
678 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
679 c31, c32, c33, c34, c35, c36)
680 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
681 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
682 c31, c32, c33, c34, c35, c36)
683 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
684 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
685 c31, c32, c33, c34, c35, c36, c37)
686 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
687 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
688 c31, c32, c33, c34, c35, c36, c37)
689 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
690 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
691 c31, c32, c33, c34, c35, c36, c37, c38)
692 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
693 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
694 c31, c32, c33, c34, c35, c36, c37, c38)
695 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
696 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
697 c31, c32, c33, c34, c35, c36, c37, c38, c39)
698 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
699 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
700 c31, c32, c33, c34, c35, c36, c37, c38, c39)
701 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
702 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
703 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40)
704 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
705 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
706 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40)
707 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
708 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
709 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
710 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
711 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
712 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41)
713 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
714 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
715 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
716 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
717 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
718 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42)
719 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
720 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
721 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43)
722 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
723 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
724 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43)
725 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
726 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
727 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44)
728 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
729 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
730 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44)
731 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
732 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
733 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
734 c45)
735 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
736 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
737 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
738 c45)
739 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
740 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
741 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
742 c45, c46)
743 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
744 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
745 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
746 c45, c46)
747 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
748 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
749 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
750 c45, c46, c47)
751 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
752 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
753 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
754 c45, c46, c47)
755 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
756 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
757 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
758 c45, c46, c47, c48)
759 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
760 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
761 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
762 c45, c46, c47, c48)
763 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
764 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
765 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
766 c45, c46, c47, c48, c49)
767 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
768 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
769 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
770 c45, c46, c47, c48, c49)
771 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
772 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
773 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
774 c45, c46, c47, c48, c49, c50)
775 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
776 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
777 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
778 c45, c46, c47, c48, c49, c50)
779 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
780 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
781 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
782 c45, c46, c47, c48, c49, c50, c51)
783 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
784 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
785 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
786 c45, c46, c47, c48, c49, c50, c51)
787 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
788 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
789 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
790 c45, c46, c47, c48, c49, c50, c51, c52)
791 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
792 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
793 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
794 c45, c46, c47, c48, c49, c50, c51, c52)
795 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
796 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
797 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
798 c45, c46, c47, c48, c49, c50, c51, c52, c53)
799 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
800 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
801 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
802 c45, c46, c47, c48, c49, c50, c51, c52, c53)
803 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
804 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
805 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
806 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54)
807 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
808 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
809 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
810 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54)
811 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
812 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
813 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
814 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55)
815 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
816 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
817 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
818 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55)
819 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
820 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
821 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
822 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56)
823 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
824 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
825 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
826 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56)
827 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
828 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
829 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
830 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57)
831 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
832 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
833 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
834 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57)
835 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
836 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
837 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
838 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58)
839 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
840 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
841 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
842 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58)
843 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
844 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
845 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
846 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
847 c59)
848 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
849 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
850 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
851 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
852 c59)
853 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
854 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
855 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
856 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
857 c59, c60)
858 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
859 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
860 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
861 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
862 c59, c60)
863 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
864 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
865 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
866 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
867 c59, c60, c61)
868 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
869 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
870 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
871 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
872 c59, c60, c61)
873 class (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
874 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
875 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
876 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
877 c59, c60, c61, c62)
878 => (c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
879 c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30,
880 c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44,
881 c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58,
882 c59, c60, c61, c62)