From 76dd48892d5c49eea68fb7841c3c9f9de59a848e Mon Sep 17 00:00:00 2001 From: Ashley Yakeley <ashley@semantic.org> Date: Sun, 19 May 2019 20:01:12 -0700 Subject: [PATCH] base: documentation for Nat HasResolution --- libraries/base/Data/Fixed.hs | 1 + libraries/base/changelog.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libraries/base/Data/Fixed.hs b/libraries/base/Data/Fixed.hs index ab517059d25..e99efea2568 100644 --- a/libraries/base/Data/Fixed.hs +++ b/libraries/base/Data/Fixed.hs @@ -83,6 +83,7 @@ instance (Typeable k,Typeable a) => Data (Fixed (a :: k)) where class HasResolution (a :: k) where resolution :: p a -> Integer +-- | For example, @Fixed 1000@ will give you a 'Fixed' with a resolution of 1000. instance KnownNat n => HasResolution n where resolution _ = natVal (Proxy :: Proxy n) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 6da0c70b36b..9fbf5273c5d 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -5,6 +5,8 @@ * Add a `TestEquality` instance for the `Compose` newtype. + * Add `HasResolution` instances for `Nat`s. + ## 4.13.0.0 *TBA* * Bundled with GHC *TBA* -- GitLab