History

Add Show for Either

Edwin Brady committed 6 years ago

Commit 1acbf1b1 parent a302be31 file · +5 −0Browse files

Unified · Split

libs/prelude/Prelude.idr+5−0
@@ -1404,6 +1404,11 @@ Show a => Show (Maybe a) where · 1403 unmodified lines
14041404 showPrec d Nothing = "Nothing"
14051405 showPrec d (Just x) = showCon d "Just" (showArg x)
14061406
1407+export
1408+(Show a, Show b) => Show (Either a b) where
1409+ showPrec d (Left x) = showCon d "Left" $ showArg x
1410+ showPrec d (Right x) = showCon d "Right" $ showArg x
1411+
14071412 --------
14081413 -- IO --
14091414 --------

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t