[rearrange prelude some more. add Prelude.CType
John Meacham <john@repetae.net>**20080215044413] addfile ./lib/base/Prelude/CType.hs
hunk ./lib/base/Data/Char.hs 8
+    module Prelude.CType,
hunk ./lib/base/Data/Char.hs 19
+import Prelude.CType
hunk ./lib/base/Data/Char.hs 21
--- Character-testing operations
-isAscii, isLatin1, isControl, isPrint, isSpace, isUpper, isLower,
- isAlpha, isDigit, isOctDigit, isHexDigit, isAlphaNum :: Char -> Bool
hunk ./lib/base/Data/Char.hs 22
-isAscii c                =  c < '\x80'
hunk ./lib/base/Data/Char.hs 23
-isLatin1 c               =  c <= '\xff'
-
-isControl c              =  c < ' ' || c >= '\DEL' && c <= '\x9f'
-
-isPrint c               =  isLatin1 c && not (isControl c)
-
-isSpace c                =  c `elem` " \t\n\r\f\v\xA0"
-
-isUpper c                =  c >= 'A' && c <= 'Z'
-
-isLower c                =  c >= 'a' && c <= 'z'
-
-isAlpha c                =  isUpper c || isLower c
-
-isDigit c                =  c >= '0' && c <= '9'
-
-isOctDigit c             =  c >= '0' && c <= '7'
-
-isHexDigit c             =  isDigit c || c >= 'A' && c <= 'F' ||
-                                         c >= 'a' && c <= 'f'
-
-isAlphaNum c             =  isAlpha c || isDigit c
-
-
--- Digit conversion operations
-digitToInt :: Char -> Int
-digitToInt c
-  | isDigit c            =  ord c - ord '0'
-  | c >= 'a' && c <= 'f' =  ord c - (ord 'a' + 10)
-  | c >= 'A' && c <= 'F' =  ord c - (ord 'A' + 10)
-  | otherwise            =  error "Char.digitToInt: not a digit"
-
-intToDigit :: Int -> Char
-intToDigit i = f (fromIntegral i :: Word) where
-    f w | w < 10 = chr (ord '0' + i)
-        | w < 16 = chr ((ord 'a' - 10) + i)
-        | otherwise = error "Char.intToDigit: not a digit"
-
-
--- Case-changing operations
-toUpper :: Char -> Char
-toUpper c | isLower c = chr $ ord c - 32
-          | otherwise = c
-
-toLower :: Char -> Char
-toLower c | isUpper c = chr $ ord c + 32
-          | otherwise = c
hunk ./lib/base/Numeric.hs 11
-import Data.Char   ( isDigit, isOctDigit, isHexDigit
+import Prelude.CType   ( isDigit, isOctDigit, isHexDigit
hunk ./lib/base/Prelude/CType.hs 1
+{-# OPTIONS_JHC -N #-}
+module Prelude.CType (
+    isAscii, isLatin1, isControl, isPrint, isSpace, isUpper, isLower,
+    isAlpha, isDigit, isOctDigit, isHexDigit, isAlphaNum,
+    digitToInt, intToDigit,
+    toUpper, toLower
+    ) where
+
+import Jhc.Basics
+import Jhc.Order
+import Jhc.Num
+import Data.Word
+import Jhc.IO
+import Jhc.List
+
+-- Character-testing operations
+isAscii, isLatin1, isControl, isPrint, isSpace, isUpper, isLower,
+ isAlpha, isDigit, isOctDigit, isHexDigit, isAlphaNum :: Char -> Bool
+
+isAscii c                =  c < '\x80'
+
+isLatin1 c               =  c <= '\xff'
+
+isControl c              =  c < ' ' || c >= '\DEL' && c <= '\x9f'
+
+isPrint c               =  isLatin1 c && not (isControl c)
+
+isSpace c                =  c `elem` " \t\n\r\f\v\xA0"
+
+isUpper c                =  c >= 'A' && c <= 'Z'
+
+isLower c                =  c >= 'a' && c <= 'z'
+
+isAlpha c                =  isUpper c || isLower c
+
+isDigit c                =  c >= '0' && c <= '9'
+
+isOctDigit c             =  c >= '0' && c <= '7'
+
+isHexDigit c             =  isDigit c || c >= 'A' && c <= 'F' ||
+                                         c >= 'a' && c <= 'f'
+
+isAlphaNum c             =  isAlpha c || isDigit c
+
+-- Digit conversion operations
+digitToInt :: Char -> Int
+digitToInt c
+  | isDigit c            =  ord c - ord '0'
+  | c >= 'a' && c <= 'f' =  ord c - (ord 'a' + 10)
+  | c >= 'A' && c <= 'F' =  ord c - (ord 'A' + 10)
+  | otherwise            =  error "Char.digitToInt: not a digit"
+
+intToDigit :: Int -> Char
+intToDigit i = f (fromIntegral i :: Word) where
+    f w | w < 10 = chr (ord '0' + i)
+        | w < 16 = chr ((ord 'a' - 10) + i)
+        | otherwise = error "Char.intToDigit: not a digit"
+
+-- Case-changing operations
+toUpper :: Char -> Char
+toUpper c | isLower c = chr $ ord c - 32
+          | otherwise = c
+
+toLower :: Char -> Char
+toLower c | isUpper c = chr $ ord c + 32
+          | otherwise = c
+
+elem    :: Char -> [Char] -> Bool
+elem _ []	= False
+elem x (y:ys)
+    | x == y = True
+    | otherwise = f y ys where
+        f y _ | x == y = True
+        f _ (y:ys) = f y ys
+        f _ [] = False
hunk ./lib/base/Prelude/Text.hs 180
+
+instance (Read a) => Read (Maybe a) where
+    readsPrec d input =
+	      (\ inp -> [((Nothing) , rest) | ("Nothing" , rest) <- lex inp])
+	      input
+	      ++
+	      readParen (d > 9)
+	      (\ inp ->
+	       [((Just aa) , rest) | ("Just" , inp) <- lex inp ,
+		(aa , rest) <- readsPrec 10 inp])
+	      input