Derive Show instance for CryptoFailable
Fixes #50 The derived instances use precedences to decide when parentheses are appropriate.
This commit is contained in:
parent
18a9634bb7
commit
5b8ae08701
@ -52,10 +52,8 @@ instance E.Exception CryptoError
|
|||||||
data CryptoFailable a =
|
data CryptoFailable a =
|
||||||
CryptoPassed a
|
CryptoPassed a
|
||||||
| CryptoFailed CryptoError
|
| CryptoFailed CryptoError
|
||||||
|
deriving (Show)
|
||||||
|
|
||||||
instance Show a => Show (CryptoFailable a) where
|
|
||||||
show (CryptoPassed a) = "CryptoPassed " ++ show a
|
|
||||||
show (CryptoFailed err) = "CryptoFailed " ++ show err
|
|
||||||
instance Eq a => Eq (CryptoFailable a) where
|
instance Eq a => Eq (CryptoFailable a) where
|
||||||
(==) (CryptoPassed a) (CryptoPassed b) = a == b
|
(==) (CryptoPassed a) (CryptoPassed b) = a == b
|
||||||
(==) (CryptoFailed e1) (CryptoFailed e2) = e1 == e2
|
(==) (CryptoFailed e1) (CryptoFailed e2) = e1 == e2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user