Add Show for Either

This commit is contained in:
Edwin Brady 2020-05-17 14:51:27 +01:00
parent a302be38f4
commit 1acbf1b67e

View File

@ -1404,6 +1404,11 @@ Show a => Show (Maybe a) where
showPrec d Nothing = "Nothing" showPrec d Nothing = "Nothing"
showPrec d (Just x) = showCon d "Just" (showArg x) showPrec d (Just x) = showCon d "Just" (showArg x)
export
(Show a, Show b) => Show (Either a b) where
showPrec d (Left x) = showCon d "Left" $ showArg x
showPrec d (Right x) = showCon d "Right" $ showArg x
-------- --------
-- IO -- -- IO --
-------- --------