Show Either
Some checks failed
Publish Playground / build (push) Has been cancelled
Publish Playground / deploy (push) Has been cancelled

This commit is contained in:
2025-12-26 19:52:18 -08:00
parent d19f39fa18
commit 70348f3e5d
2 changed files with 17 additions and 8 deletions

View File

@@ -899,6 +899,10 @@ instance ∀ a. {{Show a}} → Show (Maybe a) where
show Nothing = "Nothing"
show (Just a) = "Just \{show a}"
instance a b. {{Show a}} {{Show b}} Show (Either a b) where
show (Left a) = "Left \{show a}"
show (Right b) = "Right \{show b}"
pfunc isPrefixOf uses (True False): String String Bool := `(pfx, s) => s.startsWith(pfx) ? Prelude_True : Prelude_False`
pfunc isSuffixOf uses (True False): String String Bool := `(pfx, s) => s.endsWith(pfx) ? Prelude_True : Prelude_False`
pfunc strIndex : String Int Char := `(s, ix) => s[ix]`