Merge pull request #95 from glguy/master

Derive Show instance for CryptoFailable
This commit is contained in:
Vincent Hanquez 2016-07-30 11:08:55 +01:00 committed by GitHub
commit 39a3a6bbcb

View File

@ -52,10 +52,8 @@ instance E.Exception CryptoError
data CryptoFailable a =
CryptoPassed a
| 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
(==) (CryptoPassed a) (CryptoPassed b) = a == b
(==) (CryptoFailed e1) (CryptoFailed e2) = e1 == e2