1 module PreludeBuiltin where
5 import Core ( _readList, _showList )
9 import PS ( _PackedString, _unpackPS )
12 instance (Eq a) => Eq [a] where
14 (x:xs) == (y:ys) = x == y && xs == ys
17 xs /= ys = if (xs == ys) then False else True
19 instance (Ord a) => Ord [a] where
20 a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
21 a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
22 a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
23 a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
25 max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
26 min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
29 _tagCmp (x:xs) [] = _GT
30 _tagCmp [] (y:ys) = _LT
31 _tagCmp (x:xs) (y:ys) = case _tagCmp x y of
36 instance (Text a) => Text [a] where
37 readsPrec p = readList
38 showsPrec p = showList
40 {-# SPECIALIZE instance Eq [Char] #-}
41 {-# SPECIALIZE instance Ord [Char] #-}
42 {-# SPECIALIZE instance Text [Char] #-}
44 #if defined(__OVERLAPPING_INSTANCES__)
45 instance _CCallable [Char]
46 instance _CReturnable [Char]
49 {-# SPECIALIZE instance Eq [Int] #-}
50 {-# SPECIALIZE instance Ord [Int] #-}
51 {-# SPECIALIZE instance Text [Int] #-}
54 #if defined(__UNBOXED_INSTANCES__)
56 {-# GENERATE_SPECS instance a :: Eq [a] #-}
57 {-# GENERATE_SPECS instance a :: Ord [a] #-}
58 {-# GENERATE_SPECS instance a :: Text [a] #-}
60 instance _CCallable [Char#]
61 instance _CReturnable [Char#]