Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map to Data.String.Base #2208

Merged
merged 6 commits into from
Dec 27, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3117,6 +3117,7 @@ Additions to existing modules
```agda
wordsByᵇ : (Char → Bool) → String → List String
linesByᵇ : (Char → Bool) → String → List String
map : (Char → Char) → String → String
```

* Added new proofs in `Data.String.Properties`:
6 changes: 6 additions & 0 deletions src/Data/String/Base.agda
Original file line number Diff line number Diff line change
@@ -185,3 +185,9 @@ lines = linesByᵇ ('\n' Char.≈ᵇ_)
-- `lines` preserves empty lines
_ : lines "\nabc\n\nb\n\n\n""""abc""""b""""" ∷ []
_ = refl

map : (Char Char) String String
map f = fromList ∘ List.map f ∘ toList

_ : map Char.toUpper "abc""ABC"
_ = refl