diff --git a/libraries/base/Data/Fixed.hs b/libraries/base/Data/Fixed.hs index ab517059d250d2cc088cd02adbf0e50c6c2d059a..e99efea25682cd88d4d88bf22480452cb807570e 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 6da0c70b36b182e6568a47b69536a8037400b77b..9fbf5273c5da47d6d4ee029569155fd09eda301e 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*