Skip to content

Commit 252d8a3

Browse files
javierdiaz72WhatisRT
authored andcommitted
Add Show instance for Maybe
1 parent ad4c616 commit 252d8a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Class/Show/Instances.agda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ open import Class.Show.Core
99
Show-× : ⦃ Show A ⦄ ⦃ Show B ⦄ Show (A × B)
1010
Show-× .show (x , y) = parens $ show x ◇ " , " ◇ show y
1111

12+
Show-Maybe : ⦃ Show A ⦄ Show (Maybe A)
13+
Show-Maybe .show nothing = "nothing"
14+
Show-Maybe .show (just x) = "just " ◇ show x
15+
1216
Show-List : ⦃ Show A ⦄ Show (List A)
1317
Show-List .show = braces ∘ intersperse ", " ∘ map show
1418

0 commit comments

Comments
 (0)