From 5b8ae087015e468d5281fc39d54bed93ba6c3da7 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Thu, 28 Jul 2016 14:02:36 -0700 Subject: [PATCH] Derive Show instance for CryptoFailable Fixes #50 The derived instances use precedences to decide when parentheses are appropriate. --- Crypto/Error/Types.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Crypto/Error/Types.hs b/Crypto/Error/Types.hs index 79065ab..dff0c8b 100644 --- a/Crypto/Error/Types.hs +++ b/Crypto/Error/Types.hs @@ -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