[Git][ghc/ghc][master] Improve docs for Data.Fixed; adds 'realToFrac' as an option for conversion

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Jun 13 13:44:43 UTC 2023



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


Commits:
0128db87 by Victor Cacciari Miraldo at 2023-06-13T09:44:18-04:00
Improve docs for Data.Fixed; adds 'realToFrac' as an option for conversion
between different precisions.

- - - - -


1 changed file:

- libraries/base/Data/Fixed.hs


Changes:

=====================================
libraries/base/Data/Fixed.hs
=====================================
@@ -21,6 +21,13 @@
 -- This module also contains generalisations of 'div', 'mod', and 'divMod' to
 -- work with any 'Real' instance.
 --
+-- Automatic conversion between different 'Fixed' can be performed through
+-- 'realToFrac', bear in mind that converting to a fixed with a smaller
+-- resolution will truncate the number, losing information.
+--
+-- >>> realToFrac (0.123456 :: Pico) :: Milli
+-- 0.123
+--
 -----------------------------------------------------------------------------
 
 module Data.Fixed



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0128db8744da2d015f84eb3881ffcf573547abce

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0128db8744da2d015f84eb3881ffcf573547abce
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/20230613/4b9b1727/attachment.html>


More information about the ghc-commits mailing list