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
1404 showPrec d Nothing = "Nothing"1404 showPrec d Nothing = "Nothing"
1405 showPrec d (Just x) = showCon d "Just" (showArg x)1405 showPrec d (Just x) = showCon d "Just" (showArg x)
1406 1406
1407export
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
1407--------1412--------
1408-- IO --1413-- IO --
1409--------1414--------

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