witch 1.3.0.0 → 1.3.0.1
raw patch · 2 files changed
+4/−15 lines, 2 files
Files
- source/library/Witch/Instances.hs +3/−14
- witch.cabal +1/−1
source/library/Witch/Instances.hs view
@@ -267,11 +267,7 @@ -- | Uses 'fromIntegral' when the input is not negative. instance TryFrom.TryFrom Int.Int64 Natural.Natural where- -- This should use @eitherTryFrom fromNonNegativeIntegral@, but that causes- -- a bug in GHC 9.0.1.- -- https://mail.haskell.org/pipermail/haskell-cafe/2021-March/133540.html- tryFrom =- Utility.eitherTryFrom $ \s -> TryFrom.tryFrom (From.from s :: Integer)+ tryFrom = Utility.eitherTryFrom fromNonNegativeIntegral -- | Uses 'fromIntegral' when the input is between -16,777,215 and 16,777,215 -- inclusive.@@ -410,12 +406,7 @@ -- | Uses 'fromInteger' when the input is not negative. instance TryFrom.TryFrom Integer Natural.Natural where- -- This should use @eitherTryFrom fromNonNegativeIntegral@, but that causes- -- a bug in GHC 9.0.1. By inlining @fromNonNegativeIntegral@ and replacing- -- @fromIntegral@ with @fromInteger@, we can work around the bug.- -- https://mail.haskell.org/pipermail/haskell-cafe/2021-March/133540.html- tryFrom = Utility.eitherTryFrom $- \s -> if s < 0 then Left Exception.Underflow else Right $ fromInteger s+ tryFrom = Utility.eitherTryFrom fromNonNegativeIntegral -- | Uses 'fromIntegral' when the input is between -16,777,215 and 16,777,215 -- inclusive.@@ -622,9 +613,7 @@ -- | Uses 'fromIntegral'. instance From.From Word.Word64 Natural.Natural where- -- This should use @fromIntegral@, but that causes a bug in GHC 9.0.1.- -- https://mail.haskell.org/pipermail/haskell-cafe/2021-March/133540.html- from s = Utility.unsafeFrom (From.from s :: Integer)+ from = fromIntegral -- | Uses 'Bits.toIntegralSized'. instance TryFrom.TryFrom Word.Word64 Int.Int8 where
witch.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: witch-version: 1.3.0.0+version: 1.3.0.1 synopsis: Convert values from one type into another. description: Witch converts values from one type into another. build-type: Simple