import Core
import IInt
import IList
-import List ( map, (++), foldr )
+import List ( (++), map, takeWhile )
import PS ( _PackedString, _unpackPS )
import Text
+import TyArray
+import TyComplex
gtChar (C# x) (C# y) = gtChar# x y
geChar (C# x) (C# y) = geChar# x y
where i = ord ci
instance Enum Char where
- enumFrom c = map chr [ord c .. ord maxChar]
- enumFromThen c c' = map chr [ord c, ord c' .. ord lastChar]
- where lastChar = if c' < c then minChar else maxChar
+ enumFrom c = map chr [ord c .. ord maxChar]
+ enumFromThen c c' = map chr [ord c, ord c' .. ord lastChar]
+ where lastChar = if c' < c then minChar else maxChar
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
instance Text Char where
readsPrec p = readParen False
enumFrom c = map chr# [ord# c .. ord# '\255'#]
enumFromThen c c' = map chr# [ord# c, ord# c' .. ord# lastChar#]
where lastChar# = if c' < c then '\0'# else '\255'#
- -- default methods not specialised!
enumFromTo n m = takeWhile (<= m) (enumFrom n)
enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
(enumFromThen n m)
instance Text Char# where
readsPrec p s = map (\ (C# c#, s) -> (c#, s)) (readsPrec p s)
showsPrec p c = showsPrec p (C# c)
- readList s = map (\ (x, s) -> (map (\ (C# c#) -> c#) x, s)) (readList s)
- showList l = showList (map C# l)
+ readList = _readList (readsPrec 0)
+ showList = _showList (showsPrec 0)
instance _CCallable Char#
instance _CReturnable Char#