String.agda 684 B

123456789101112131415161718192021222324252627282930313233
  1. {-# OPTIONS --without-K #-}
  2. module Common.String where
  3. open import Agda.Builtin.String public
  4. open import Common.Bool
  5. open import Common.Char
  6. open import Common.List
  7. open import Common.Nat
  8. open import Common.Integer
  9. strEq : (x y : String) -> Bool
  10. strEq = primStringEquality
  11. infixr 30 _+S+_
  12. _+S+_ : (x y : String) -> String
  13. _+S+_ = primStringAppend
  14. fromList : List Char -> String
  15. fromList = primStringFromList
  16. stringToList : String -> List Char
  17. stringToList = primStringToList
  18. charToStr : Char → String
  19. charToStr c = primStringFromList (c ∷ [])
  20. intToString : Integer → String
  21. intToString = primShowInteger
  22. natToString : Nat -> String
  23. natToString n = intToString (pos n)