[Git][ghc/ghc][master] 4 commits: ghc classes documentation: rm redundant comment

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Aug 31 04:05:14 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
99fff496 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
ghc classes documentation: rm redundant comment

- - - - -
fe021bab by Dominik Schrempf at 2023-08-31T00:04:46-04:00
prelude documentation: various nits

- - - - -
48c84547 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
integer documentation: minor corrections

- - - - -
20cd12f4 by Dominik Schrempf at 2023-08-31T00:04:46-04:00
real documentation: nits

- - - - -


5 changed files:

- libraries/base/Data/Tuple.hs
- libraries/base/GHC/Enum.hs
- libraries/base/GHC/Real.hs
- libraries/ghc-bignum/src/GHC/Num/Integer.hs
- libraries/ghc-prim/GHC/Classes.hs


Changes:

=====================================
libraries/base/Data/Tuple.hs
=====================================
@@ -41,7 +41,7 @@ fst (x,_)               =  x
 snd                     :: (a,b) -> b
 snd (_,y)               =  y
 
--- | 'curry' converts an uncurried function to a curried function.
+-- | Convert an uncurried function to a curried function.
 --
 -- ==== __Examples__
 --


=====================================
libraries/base/GHC/Enum.hs
=====================================
@@ -82,9 +82,9 @@ class  Bounded a  where
 -- >              | otherwise                = minBound
 --
 class  Enum a   where
-    -- | the successor of a value.  For numeric types, 'succ' adds 1.
+    -- | Successor of a value. For numeric types, 'succ' adds 1.
     succ                :: a -> a
-    -- | the predecessor of a value.  For numeric types, 'pred' subtracts 1.
+    -- | Predecessor of a value. For numeric types, 'pred' subtracts 1.
     pred                :: a -> a
     -- | Convert from an 'Int'.
     toEnum              :: Int -> a
@@ -92,11 +92,10 @@ class  Enum a   where
     -- It is implementation-dependent what 'fromEnum' returns when
     -- applied to a value that is too large to fit in an 'Int'.
     fromEnum            :: a -> Int
-
     -- | Used in Haskell's translation of @[n..]@ with @[n..] = enumFrom n@,
     --   a possible implementation being @enumFrom n = n : enumFrom (succ n)@.
-    --   For example:
     --
+    --   ==== __Examples__
     --     * @enumFrom 4 :: [Integer] = [4,5,6,7,...]@
     --     * @enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]@
     enumFrom            :: a -> [a]
@@ -104,22 +103,28 @@ class  Enum a   where
     --   with @[n,n'..] = enumFromThen n n'@, a possible implementation being
     --   @enumFromThen n n' = n : n' : worker (f x) (f x n')@,
     --   @worker s v = v : worker s (s v)@, @x = fromEnum n' - fromEnum n@ and
-    --   @f n y
+    --
+    --   @
+    --   f n y
     --     | n > 0 = f (n - 1) (succ y)
     --     | n < 0 = f (n + 1) (pred y)
-    --     | otherwise = y@
-    --   For example:
+    --     | otherwise = y
+    --   @
     --
+    --   ==== __Examples__
     --     * @enumFromThen 4 6 :: [Integer] = [4,6,8,10...]@
     --     * @enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]@
     enumFromThen        :: a -> a -> [a]
     -- | Used in Haskell's translation of @[n..m]@ with
     --   @[n..m] = enumFromTo n m@, a possible implementation being
-    --   @enumFromTo n m
+    --
+    --   @
+    --   enumFromTo n m
     --      | n <= m = n : enumFromTo (succ n) m
-    --      | otherwise = []@.
-    --   For example:
+    --      | otherwise = []
+    --   @
     --
+    --   ==== __Examples__
     --     * @enumFromTo 6 10 :: [Int] = [6,7,8,9,10]@
     --     * @enumFromTo 42 1 :: [Integer] = []@
     enumFromTo          :: a -> a -> [a]
@@ -127,15 +132,23 @@ class  Enum a   where
     --   @[n,n'..m] = enumFromThenTo n n' m@, a possible implementation
     --   being @enumFromThenTo n n' m = worker (f x) (c x) n m@,
     --   @x = fromEnum n' - fromEnum n@, @c x = bool (>=) (<=) (x > 0)@
-    --   @f n y
+    --
+    --   @
+    --   f n y
     --      | n > 0 = f (n - 1) (succ y)
     --      | n < 0 = f (n + 1) (pred y)
-    --      | otherwise = y@ and
-    --   @worker s c v m
+    --      | otherwise = y
+    --   @
+    --
+    --   and
+    --
+    --   @
+    --   worker s c v m
     --      | c v m = v : worker s c (s v) m
-    --      | otherwise = []@
-    --   For example:
+    --      | otherwise = []
+    --   @
     --
+    --   ==== __Examples__
     --     * @enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]@
     --     * @enumFromThenTo 6 8 2 :: [Int] = []@
     enumFromThenTo      :: a -> a -> a -> [a]


=====================================
libraries/base/GHC/Real.hs
=====================================
@@ -212,7 +212,7 @@ denominator (_ :% y)    =  y
 -- 'Foreign.C.Types.CDouble', etc., because these types contain non-finite values,
 -- which cannot be roundtripped through 'Rational'.
 class  (Num a, Ord a) => Real a  where
-    -- | the rational equivalent of its real argument with full precision
+    -- | Rational equivalent of its real argument with full precision.
     toRational          ::  a -> Rational
 
 -- | Integral numbers, supporting integer division.
@@ -233,41 +233,41 @@ class  (Num a, Ord a) => Real a  where
 -- In addition, 'toInteger` should be total, and 'fromInteger' should be a left
 -- inverse for it, i.e. @fromInteger (toInteger i) = i at .
 class  (Real a, Enum a) => Integral a  where
-    -- | integer division truncated toward zero
+    -- | Integer division truncated toward zero.
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     quot                :: a -> a -> a
-    -- | integer remainder, satisfying
+    -- | Integer remainder, satisfying
     --
     -- > (x `quot` y)*y + (x `rem` y) == x
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     rem                 :: a -> a -> a
-    -- | integer division truncated toward negative infinity
+    -- | Integer division truncated toward negative infinity.
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     div                 :: a -> a -> a
-    -- | integer modulus, satisfying
+    -- | Integer modulus, satisfying
     --
     -- > (x `div` y)*y + (x `mod` y) == x
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     mod                 :: a -> a -> a
-    -- | simultaneous 'quot' and 'rem'
+    -- | Simultaneous 'quot' and 'rem'.
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     quotRem             :: a -> a -> (a,a)
-    -- | simultaneous 'div' and 'mod'
+    -- | simultaneous 'div' and 'mod'.
     --
     -- WARNING: This function is partial (because it throws when 0 is passed as
     -- the divisor) for all the integer types in @base at .
     divMod              :: a -> a -> (a,a)
-    -- | conversion to 'Integer'
+    -- | Conversion to 'Integer'.
     toInteger           :: a -> Integer
 
     {-# INLINE quot #-}


=====================================
libraries/ghc-bignum/src/GHC/Num/Integer.hs
=====================================
@@ -167,11 +167,11 @@ default ()
 -- Integers are stored in a kind of sign-magnitude form, hence do not expect
 -- two's complement form when using bit operations.
 --
--- If the value is small (fit into an 'Int'), 'IS' constructor is used.
--- Otherwise 'IP' and 'IN' constructors are used to store a 'BigNat'
--- representing respectively the positive or the negative value magnitude.
+-- If the value is small (i.e., fits into an 'Int'), the 'IS' constructor is
+-- used. Otherwise 'IP' and 'IN' constructors are used to store a 'BigNat'
+-- representing the positive or the negative value magnitude, respectively.
 --
--- Invariant: 'IP' and 'IN' are used iff value doesn't fit in 'IS'
+-- Invariant: 'IP' and 'IN' are used iff the value does not fit in 'IS'.
 data Integer
    = IS !Int#    -- ^ iff value in @[minBound::'Int', maxBound::'Int']@ range
    | IP !BigNat# -- ^ iff value in @]maxBound::'Int', +inf[@ range


=====================================
libraries/ghc-prim/GHC/Classes.hs
=====================================
@@ -141,9 +141,6 @@ and @('>=')@ for the types in "GHC.Word" and "GHC.Int".
 -- [__Extensionality__]: if @x == y@ = 'True' and @f@ is a function
 -- whose return type is an instance of 'Eq', then @f x == f y@ = 'True'
 -- [__Negation__]: @x /= y@ = @not (x == y)@
---
--- Minimal complete definition: either '==' or '/='.
---
 class  Eq a  where
     (==), (/=)           :: a -> a -> Bool
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5d56d05ce591a99b94e250765fef9fc61a0b1b53...20cd12f4cfce34ff5344d6921cba5e9c4cd7f611

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5d56d05ce591a99b94e250765fef9fc61a0b1b53...20cd12f4cfce34ff5344d6921cba5e9c4cd7f611
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230831/078d0f92/attachment-0001.html>


More information about the ghc-commits mailing list