mirror of
https://github.com/tfausak/witch.git
synced 2024-11-23 00:06:27 +03:00
Use more succinct definition
This commit is contained in:
parent
dc2af8f277
commit
f5fc6ed6df
@ -254,9 +254,7 @@ instance TryFrom.TryFrom Int.Int64 Natural.Natural where
|
|||||||
-- This should use @eitherTryFrom fromNonNegativeIntegral@, but that causes
|
-- This should use @eitherTryFrom fromNonNegativeIntegral@, but that causes
|
||||||
-- a bug in GHC 9.0.1.
|
-- a bug in GHC 9.0.1.
|
||||||
-- https://mail.haskell.org/pipermail/haskell-cafe/2021-March/133540.html
|
-- https://mail.haskell.org/pipermail/haskell-cafe/2021-March/133540.html
|
||||||
tryFrom s = case TryFrom.tryFrom (From.from s :: Integer) of
|
tryFrom = Utility.eitherTryFrom $ \ s -> TryFrom.tryFrom (From.from s :: Integer)
|
||||||
Left (TryFromException.TryFromException _ e) -> Left $ TryFromException.TryFromException s e
|
|
||||||
Right t -> Right t
|
|
||||||
|
|
||||||
-- | Uses 'fromIntegral' when the input is between -16,777,215 and 16,777,215
|
-- | Uses 'fromIntegral' when the input is between -16,777,215 and 16,777,215
|
||||||
-- inclusive.
|
-- inclusive.
|
||||||
|
Loading…
Reference in New Issue
Block a user