X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FNum.lhs;h=17d35ef1c74fc0ae01ebd3eb61cae0a58b7e0c7e;hb=b7b024c10bdf1e3c7c9becf83ebf6e90bee8511f;hp=52c2a7b871a419dd1771099ccdb1e99993e865e8;hpb=7de50399a42ee49b0473b7b6eea2b44a2f941a12;p=ghc-base.git diff --git a/GHC/Num.lhs b/GHC/Num.lhs index 52c2a7b..17d35ef 100644 --- a/GHC/Num.lhs +++ b/GHC/Num.lhs @@ -1,22 +1,18 @@ -% ------------------------------------------------------------------------------ -% $Id: Num.lhs,v 1.4 2002/02/05 17:32:26 simonmar Exp $ -% -% (c) The University of Glasgow, 1994-2000 -% - -\section[GHC.Num]{Module @GHC.Num@} - -The class - - Num - -and the type - - Integer - - \begin{code} {-# OPTIONS -fno-implicit-prelude #-} +----------------------------------------------------------------------------- +-- | +-- Module : GHC.Num +-- Copyright : (c) The University of Glasgow 1994-2002 +-- License : see libraries/base/LICENSE +-- +-- Maintainer : cvs-ghc@haskell.org +-- Stability : internal +-- Portability : non-portable (GHC Extensions) +-- +-- The 'Num' class and the 'Integer' type. +-- +----------------------------------------------------------------------------- #include "MachDeps.h" #if SIZEOF_HSWORD == 4 @@ -83,15 +79,9 @@ instance Num Int where | otherwise = 1 fromInteger = integer2Int -\end{code} - - -\begin{code} --- These can't go in GHC.Base with the defn of Int, because --- we don't have pairs defined at that time! quotRemInt :: Int -> Int -> (Int, Int) -a@(I# _) `quotRemInt` b@(I# _) = (a `quotInt` b, a `remInt` b) +quotRemInt a@(I# _) b@(I# _) = (a `quotInt` b, a `remInt` b) -- OK, so I made it a little stricter. Shoot me. (WDP 94/10) divModInt :: Int -> Int -> (Int, Int) @@ -99,7 +89,6 @@ divModInt x@(I# _) y@(I# _) = (x `divInt` y, x `modInt` y) -- Stricter. Sorry if you don't like it. (WDP 94/10) \end{code} - %********************************************************* %* * \subsection{The @Integer@ type} @@ -107,6 +96,7 @@ divModInt x@(I# _) y@(I# _) = (x `divInt` y, x `modInt` y) %********************************************************* \begin{code} +-- | Arbitrary-precision integers. data Integer = S# Int# -- small integers #ifndef ILX