[create Jhc.Class.Real to hold more advance numeric classes.
John Meacham <john@repetae.net>**20120206061314
 Ignore-this: b604268ae804a0ffc665af0115ac515
] hunk ./lib/jhc/Data/Char.hs 16
--- CI import Jhc.IO
--- CI import Jhc.Inst.Show
hunk ./lib/jhc/Data/Ratio.hs 11
--- CI import Jhc.Type.Basic
hunk ./lib/jhc/Data/Ratio.hs 13
+import Jhc.Type.Basic
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Foreign/C/Error.hs 93
--- CI import Foreign.C.Types
hunk ./lib/jhc/Foreign/C/Error.hs 103
--- CI import System.IO.Unsafe		( unsafePerformIO )
hunk ./lib/jhc/Foreign/C/String.hs 101
--- CI import Data.Word
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 55
--- CI import Jhc.IO
--- CI import Jhc.List
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 58
-import Jhc.Maybe
-import Jhc.Inst.Storable
-
+import Jhc.Inst.Storable()
+import Jhc.Type.Basic
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 93
-
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 107
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 132
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 146
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 161
-
hunk ./lib/jhc/Foreign/Marshal/Utils.hs 168
+
+maybe :: b -> (a -> b) -> Maybe a -> b
+maybe n f m = case m of
+    Just x -> f x
+    Nothing -> n
hunk ./lib/jhc/Foreign/Ptr.hs 18
--- CI import Data.Word
--- CI import Foreign.Storable
hunk ./lib/jhc/Foreign/Ptr.hs 20
+import Jhc.Class.Num
hunk ./lib/jhc/Foreign/Ptr.hs 23
--- CI import Jhc.Monad
-import Jhc.Num
--- CI import Jhc.Order
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Foreign/Ptr.hs 26
-    showsPrec n x = showsPrec n (toInteger (ptrToWordPtr  x))
+    showsPrec n x = showsPrec n ((ptrToWordPtr  x))
hunk ./lib/jhc/Foreign/Storable.hs 8
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Jhc/Addr.hs 15
--- CI import Jhc.Prim
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Jhc/Class/Num.hs 4
-import Jhc.Basics
-import Jhc.Order
+import Jhc.Class.Ord
hunk ./lib/jhc/Jhc/Class/Num.hs 6
-import Jhc.IO(error)
-import Jhc.Enum
-import Jhc.Float
-import Jhc.Type.Float
+import Jhc.Type.Basic
hunk ./lib/jhc/Jhc/Class/Num.hs 8
-infixl 7  *  , /, `quot`, `rem`, `div`, `mod`
+infixl 7  *
hunk ./lib/jhc/Jhc/Class/Num.hs 11
-type  Rational = Ratio Integer
-
hunk ./lib/jhc/Jhc/Class/Num.hs 22
-    fromInt i = fromInteger (toInteger i)
-    fromInteger x = fromInt (toInt x)
-
-class  (Num a, Ord a) => Real a  where
-    toRational       ::  a -> Rational
-    toDouble         ::  a -> Double
-    toDouble x = rationalToDouble (toRational x)
-
-class  (Real a, Enum a) => Integral a  where
-    quot, rem        :: a -> a -> a
-    div, mod         :: a -> a -> a
-    quotRem, divMod  :: a -> a -> (a,a)
-    toInteger        :: a -> Integer
-    toInt            :: a -> Int
-
-        -- Minimal complete definition:
-        --      quotRem, toInteger
-    n `quot` d       =  q  where (q,r) = quotRem n d
-    n `rem` d        =  r  where (q,r) = quotRem n d
-    n `div` d        =  q  where (q,r) = divMod n d
-    n `mod` d        =  r  where (q,r) = divMod n d
-    divMod n d       =  if signum r == - signum d then (q-1, r+d) else qr
-                        where qr@(q,r) = quotRem n d
-    quotRem n d       =  (n `quot` d, n `rem` d)
-    toInteger x = toInteger (toInt x)
-    toInt x = toInt (toInteger x)
-
-class  (Num a) => Fractional a  where
-    (/)              :: a -> a -> a
-    recip            :: a -> a
-    fromRational     :: Rational -> a
-    fromDouble       :: Double   -> a
-
-        -- Minimal complete definition:
-        --      fromRational and (recip or (/))
-    recip x          =  1 / x
-    x / y            =  x * recip y
+    fromInt i = fromInteger (int2integer i)
+    fromInteger x = fromInt (integer2int x)
hunk ./lib/jhc/Jhc/Class/Num.hs 25
-    --fromDouble x = fromRational (doubleToRational x)
+foreign import "I2I" integer2int :: Integer -> Int
+foreign import "I2I" int2integer :: Int -> Integer
hunk ./lib/jhc/Jhc/Class/Ord.hs 3
--- CI import Jhc.Type.Basic
hunk ./lib/jhc/Jhc/Class/Ord.hs 17
-class  (Eq a) => Ord a  where
+class (Eq a) => Ord a where
addfile ./lib/jhc/Jhc/Class/Real.hs
hunk ./lib/jhc/Jhc/Class/Real.hs 1
+module Jhc.Class.Real where
+
+import Jhc.Basics
+import Jhc.Class.Num
+import Jhc.Class.Ord
+import Jhc.Enum
+import Jhc.Float
+import Jhc.Type.Float
+
+infixl 7  /, `quot`, `rem`, `div`, `mod`
+
+type  Rational = Ratio Integer
+
+class  (Num a, Ord a) => Real a  where
+    toRational       ::  a -> Rational
+    toDouble         ::  a -> Double
+    toDouble x = rationalToDouble (toRational x)
+
+class  (Real a, Enum a) => Integral a  where
+    quot, rem        :: a -> a -> a
+    div, mod         :: a -> a -> a
+    quotRem, divMod  :: a -> a -> (a,a)
+    toInteger        :: a -> Integer
+    toInt            :: a -> Int
+
+        -- Minimal complete definition:
+        --      quotRem, toInteger
+    n `quot` d       =  q  where (q,r) = quotRem n d
+    n `rem` d        =  r  where (q,r) = quotRem n d
+    n `div` d        =  q  where (q,r) = divMod n d
+    n `mod` d        =  r  where (q,r) = divMod n d
+    divMod n d       =  if signum r == - signum d then (q-1, r+d) else qr
+                        where qr@(q,r) = quotRem n d
+    quotRem n d       =  (n `quot` d, n `rem` d)
+    toInteger x = toInteger (toInt x)
+    toInt x = toInt (toInteger x)
+
+class  (Num a) => Fractional a  where
+    (/)              :: a -> a -> a
+    recip            :: a -> a
+    fromRational     :: Rational -> a
+    fromDouble       :: Double   -> a
+
+        -- Minimal complete definition:
+        --      fromRational and (recip or (/))
+    recip x          =  1 / x
+    x / y            =  x * recip y
+
+    --fromDouble x = fromRational (doubleToRational x)
hunk ./lib/jhc/Jhc/Enum.hs 8
---import Jhc.Prim.Bits
--- CI import Jhc.Prim.Prim
--- CI import Jhc.Type.Basic
--- CI import Jhc.Type.Word
hunk ./lib/jhc/Jhc/Enum.m4 13
-                                 | otherwise = maxBound
+                                 | True      = maxBound
hunk ./lib/jhc/Jhc/Enum.m4 16
-            | otherwise = x:f (x + 1)
+            | True  = x:f (x + 1)
hunk ./lib/jhc/Jhc/Enum.m4 20
-            | otherwise = []
+            | True   = []
hunk ./lib/jhc/Jhc/Enum.m4 24
-            | otherwise = []
+            | True   = []
hunk ./lib/jhc/Jhc/Float.hs 11
-    )
-    where
+    ) where
hunk ./lib/jhc/Jhc/Float.hs 15
-import Jhc.IO(error)
hunk ./lib/jhc/Jhc/Float.hs 16
--- CI import Jhc.Int
-import Jhc.Num
+import Jhc.Class.Ord
hunk ./lib/jhc/Jhc/Float.hs 18
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Jhc/Float.hs 19
--- CI import Prelude.Text
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Float.hs 205
-
hunk ./lib/jhc/Jhc/Handle.hs 19
--- CI import Foreign.C.Types
hunk ./lib/jhc/Jhc/Handle.hs 20
--- CI import Foreign.Ptr
hunk ./lib/jhc/Jhc/Handle.hs 24
--- CI import Jhc.IO
--- CI import Jhc.Maybe
hunk ./lib/jhc/Jhc/IO.hs 32
--- CI import Foreign.C.Types
hunk ./lib/jhc/Jhc/IO.hs 33
--- CI import Jhc.Order
hunk ./lib/jhc/Jhc/IO.hs 34
--- CI import Jhc.Prim.IO
--- CI import Jhc.Type.Basic
hunk ./lib/jhc/Jhc/Inst/Enum.hs 2
-
hunk ./lib/jhc/Jhc/Inst/Enum.hs 4
--- CI import Data.Word
--- CI import Data.Int
hunk ./lib/jhc/Jhc/Inst/Enum.hs 5
-import Jhc.Num
-import Jhc.Order
+import Jhc.Class.Num
+import Jhc.Class.Real
+import Jhc.Class.Ord
hunk ./lib/jhc/Jhc/Inst/Enum.hs 10
--- CI import Jhc.Inst.Order
hunk ./lib/jhc/Jhc/Inst/Enum.hs 65
-             | otherwise    = error "Prelude.Enum.().toEnum: bad argument"
+             | True    = error "Prelude.Enum.().toEnum: bad argument"
hunk ./lib/jhc/Jhc/Inst/Num.hs 6
--- CI import Data.Word
--- CI import Data.Int
hunk ./lib/jhc/Jhc/Inst/Num.hs 10
--- CI import Jhc.Inst.Order
hunk ./lib/jhc/Jhc/Inst/Num.hs 13
+import Jhc.Type.Basic
+import Jhc.Class.Num
+import Jhc.Class.Ord
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Inst/PrimEnum.hs 10
--- CI import Jhc.Prim
hunk ./lib/jhc/Jhc/Inst/Show.hs 2
-
hunk ./lib/jhc/Jhc/Inst/Show.hs 4
-import Data.Int
-import Data.Word
hunk ./lib/jhc/Jhc/Inst/Show.hs 5
+import Jhc.Class.Num
+import Jhc.Class.Ord
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Inst/Show.hs 9
-import Jhc.Num
-import Jhc.Order
hunk ./lib/jhc/Jhc/Inst/Show.hs 10
+import Jhc.Type.Basic
hunk ./lib/jhc/Jhc/Inst/Show.hs 15
+fromIntegral   :: (Integral a, Num b) => a -> b
+fromIntegral x =  fromInteger (toInteger x)
+
hunk ./lib/jhc/Jhc/Inst/Show.hs 43
-        | otherwise = showWord (fromIntegral x :: Word)
+        | True = showWord (fromIntegral x :: Word)
hunk ./lib/jhc/Jhc/Inst/Show.hs 49
-        | otherwise = showWordMax (fromIntegral x :: WordMax)
+        | True = showWordMax (fromIntegral x :: WordMax)
hunk ./lib/jhc/Jhc/Inst/Storable.hs 4
--- CI import Data.Int
--- CI import Data.Word
--- CI import Jhc.Type.Word
hunk ./lib/jhc/Jhc/Inst/Storable.hs 10
+import Jhc.Type.Word
hunk ./lib/jhc/Jhc/Num.hs 4
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Numeric.hs 6
--- CI import Jhc.Type.Float
hunk ./lib/jhc/Jhc/Numeric.hs 8
+import Jhc.Type.Float
+
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Order.hs 14
-import Jhc.Basics
--- CI import Jhc.Prim.Bits
--- CI import Jhc.Prim.Prim
-
hunk ./lib/jhc/Jhc/Order.hs 15
+import Jhc.Basics
hunk ./lib/jhc/Jhc/Prim.hs 5
--- CI import Jhc.String
hunk ./lib/jhc/Jhc/Prim.hs 6
--- CI import Jhc.Type.Word
hunk ./lib/jhc/Jhc/Show.hs 5
--- CI import Jhc.Order
hunk ./lib/jhc/Jhc/String.hs 13
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Jhc/Text/Read.hs 9
--- CI import Jhc.Type.Basic
hunk ./lib/jhc/Jhc/Text/Read.hs 10
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Jhc/Type/Basic.hs 4
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Jhc/Type/Basic.hs 15
---type Bool__ = Bits16_
hunk ./lib/jhc/Jhc/Type/Handle.hs 3
--- CI import Jhc.Prim
hunk ./lib/jhc/Jhc/Type/Handle.hs 5
--- CI import Jhc.Type.Basic
hunk ./lib/jhc/Numeric.hs 24
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Prelude.hs 69
--- CI import Jhc.Inst.Enum
--- CI import Jhc.Inst.Num
--- CI import Jhc.Inst.Order
--- CI import Jhc.Inst.Read
--- CI import Jhc.Inst.Show
--- CI import Jhc.Inst.Storable
+import Jhc.Inst.Enum()
+import Jhc.Inst.Num()
+import Jhc.Inst.Order()
+import Jhc.Inst.Read()
+import Jhc.Inst.Show()
+import Jhc.Inst.Storable()
hunk ./lib/jhc/Prelude.hs 94
+import Jhc.Class.Num
+import Jhc.Class.Real
+
hunk ./lib/jhc/Prelude/Float.hs 15
--- CI import Jhc.Prim.Bits
hunk ./lib/jhc/Prelude/Float.hs 20
+import Jhc.Class.Num
+import Jhc.Class.Real
hunk ./lib/jhc/Prelude/IO.hs 23
---import Foreign.C.Types
hunk ./lib/jhc/Prelude/IO.hs 24
--- CI import Foreign.Ptr
hunk ./lib/jhc/Prelude/Text.hs 12
-import Jhc.Maybe
+--import Jhc.Maybe
hunk ./lib/jhc/Prelude/Text.hs 19
+import Jhc.Type.Basic
hunk ./lib/jhc/System/Mem.hs 5
--- CI import Jhc.Basics
hunk ./lib/jhc/jhc.yaml 63
-
+        - Jhc.Class.Real
hunk ./src/data/names.txt 106
-Real            Jhc.Class.Num.Real
-Integral	Jhc.Class.Num.Integral
-Fractional	Jhc.Class.Num.Fractional
+Real            Jhc.Class.Real.Real
+Integral	Jhc.Class.Real.Integral
+Fractional	Jhc.Class.Real.Fractional
hunk ./src/data/names.txt 143
-fromRational         Jhc.Class.Num.fromRational
+fromRational         Jhc.Class.Real.fromRational