Skip to content

Commit

Permalink
base: Various haddock fixes
Browse files Browse the repository at this point in the history
Just a few things I found while looking at #17383.
  • Loading branch information
bgamari authored and Marge Bot committed Oct 31, 2019
1 parent a9743eb commit 73d6e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libraries/base/Data/Fixed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ import Text.Read.Lex

default () -- avoid any defaulting shenanigans

-- | generalisation of 'div' to any instance of 'Real'
-- | Generalisation of 'div' to any instance of 'Real'
div' :: (Real a,Integral b) => a -> a -> b
div' n d = floor ((toRational n) / (toRational d))

-- | generalisation of 'divMod' to any instance of 'Real'
-- | Generalisation of 'divMod' to any instance of 'Real'
divMod' :: (Real a,Integral b) => a -> a -> (b,a)
divMod' n d = (f,n - (fromIntegral f) * d) where
f = div' n d

-- | generalisation of 'mod' to any instance of 'Real'
-- | Generalisation of 'mod' to any instance of 'Real'
mod' :: (Real a) => a -> a -> a
mod' n d = n - (fromInteger f) * d where
f = div' n d
Expand Down
4 changes: 2 additions & 2 deletions libraries/base/GHC/Real.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ class (Num a, Ord a) => Real a where
--
-- The Haskell Report defines no laws for 'Integral'. However, 'Integral'
-- instances are customarily expected to define a Euclidean domain and have the
-- following properties for the `div`\/`mod` and `quot`\/`rem` pairs, given
-- following properties for the 'div'\/'mod' and 'quot'\/'rem' pairs, given
-- suitable Euclidean functions @f@ and @g@:
--
-- * @x@ = @y * quot x y + rem x y@ with @rem x y@ = @fromInteger 0@ or
-- @g (rem x y)@ < @g y@
-- * @x@ = @y * div x y + mod x y@ with @mod x y@ = @fromInteger 0@ or
-- @f (mod x y)@ < @f y@
--
-- An example of a suitable Euclidean function, for `Integer`'s instance, is
-- An example of a suitable Euclidean function, for 'Integer'\'s instance, is
-- 'abs'.
class (Real a, Enum a) => Integral a where
-- | integer division truncated toward zero
Expand Down

0 comments on commit 73d6e50

Please sign in to comment.