File tree Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -80,3 +80,8 @@ Additions to existing modules
80
80
pred-injective : .{{NonZero m}} → .{{NonZero n}} → pred m ≡ pred n → m ≡ n
81
81
pred-cancel-≡ : pred m ≡ pred n → ((m ≡ 0 × n ≡ 1) ⊎ (m ≡ 1 × n ≡ 0)) ⊎ m ≡ n
82
82
```
83
+
84
+ * Added new functions in ` Data.String.Base ` :
85
+ ``` agda
86
+ map : (Char → Char) → String → String
87
+ ```
Original file line number Diff line number Diff line change @@ -185,3 +185,9 @@ lines = linesByᵇ ('\n' Char.≈ᵇ_)
185
185
-- `lines` preserves empty lines
186
186
_ : lines "\nabc\n\nb\n\n\n" ≡ "" ∷ "abc" ∷ "" ∷ "b" ∷ "" ∷ "" ∷ []
187
187
_ = refl
188
+
189
+ map : (Char → Char) → String → String
190
+ map f = fromList ∘ List.map f ∘ toList
191
+
192
+ _ : map Char.toUpper "abc" ≡ "ABC"
193
+ _ = refl
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ open import Data.DifferenceList as DList renaming (DiffList to DList) using ()
15
15
open import Data.List.Base as List using (List; []; [_]; _∷_; _∷ʳ_)
16
16
open import Data.Nat.Base using (ℕ; _∸_)
17
17
open import Data.Product.Base using (_×_; _,_)
18
- open import Data.String.Base hiding (show )
18
+ open import Data.String.Base using (String; _++_ )
19
19
open import Data.Tree.Rose using (Rose; node; map; fromBinary)
20
20
open import Function.Base using (flip; _∘′_; id)
21
21
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module IO where
11
11
open import Codata.Musical.Notation
12
12
open import Codata.Musical.Costring
13
13
open import Data.Unit.Polymorphic.Base
14
- open import Data.String.Base
14
+ open import Data.String.Base using (String)
15
15
import Data.Unit.Base as Unit0
16
16
open import Function.Base using (_∘_; flip)
17
17
import IO.Primitive as Prim
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ open import Data.Maybe.Base hiding (map)
15
15
open import Data.Nat.Base using (ℕ)
16
16
open import Data.Product.Base hiding (map)
17
17
open import Data.Product.Nary.NonDependent
18
- open import Data.String.Base
18
+ open import Data.String.Base using (String)
19
19
open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
20
20
open import Data.Unit.Base using (⊤)
21
21
open import Function.Nary.NonDependent
You can’t perform that action at this time.
0 commit comments