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
8080 pred-injective : .{{NonZero m}} → .{{NonZero n}} → pred m ≡ pred n → m ≡ n
8181 pred-cancel-≡ : pred m ≡ pred n → ((m ≡ 0 × n ≡ 1) ⊎ (m ≡ 1 × n ≡ 0)) ⊎ m ≡ n
8282 ```
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.≈ᵇ_)
185185-- `lines` preserves empty lines
186186_ : lines "\nabc\n\nb\n\n\n" ≡ "" ∷ "abc" ∷ "" ∷ "b" ∷ "" ∷ "" ∷ []
187187_ = 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 ()
1515open import Data.List.Base as List using (List; []; [_]; _∷_; _∷ʳ_)
1616open import Data.Nat.Base using (ℕ; _∸_)
1717open import Data.Product.Base using (_×_; _,_)
18- open import Data.String.Base hiding (show )
18+ open import Data.String.Base using (String; _++_ )
1919open import Data.Tree.Rose using (Rose; node; map; fromBinary)
2020open import Function.Base using (flip; _∘′_; id)
2121
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module IO where
1111open import Codata.Musical.Notation
1212open import Codata.Musical.Costring
1313open import Data.Unit.Polymorphic.Base
14- open import Data.String.Base
14+ open import Data.String.Base using (String)
1515import Data.Unit.Base as Unit0
1616open import Function.Base using (_∘_; flip)
1717import 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)
1515open import Data.Nat.Base using (ℕ)
1616open import Data.Product.Base hiding (map)
1717open import Data.Product.Nary.NonDependent
18- open import Data.String.Base
18+ open import Data.String.Base using (String)
1919open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
2020open import Data.Unit.Base using (⊤)
2121open import Function.Nary.NonDependent
You can’t perform that action at this time.
0 commit comments