Add Usv type to Str exports, and reformat Str interface generally

This commit is contained in:
Chadtech 2021-05-02 14:31:17 -04:00
parent cf06eb8737
commit 0e39675d68
3 changed files with 43 additions and 3 deletions

View file

@ -1,8 +1,46 @@
interface Str
exposes [ Str, decimal, split, isEmpty, startsWith, endsWith, contains, anyGraphemes, allGraphemes, join, joinWith, padGraphemesStart, padGraphemesEnd, graphemes, reverseGraphemes, isCaseInsensitiveEq, isCaseInsensitiveNeq, walkGraphemes, isCapitalized, isAllUppercase, isAllLowercase, toUtf8, toUtf16, toUtf32, trim, walkUtf8, walkUtf16, walkUtf32, walkRevUtf8, walkRevUtf16, walkRevUtf32 ]
imports []
## # Types
exposes
[
Str,
Usv,
decimal,
split,
isEmpty,
startsWith,
endsWith,
contains,
anyGraphemes,
allGraphemes,
join,
joinWith,
padGraphemesStart,
padGraphemesEnd,
graphemes,
reverseGraphemes,
isCaseInsensitiveEq,
isCaseInsensitiveNeq,
walkGraphemes,
isCapitalized,
isAllUppercase,
isAllLowercase,
toUtf8,
toUtf16,
toUtf32,
trim,
walkUtf8,
walkUtf16,
walkUtf32,
walkRevUtf8,
walkRevUtf16,
walkRevUtf32
]
imports
[
Bytes.{ Bytes }
]
## # Types
##
## Dealing with text is a deep topic, so by design, Roc's `Str` module sticks
## to the basics.
##

View file

@ -48,6 +48,7 @@ pub fn standard_stdlib() -> StdLib {
Symbol::SET_SET,
Symbol::DICT_DICT,
Symbol::STR_STR,
Symbol::STR_USV,
]
.into_iter()
.collect(),

View file

@ -889,6 +889,7 @@ define_builtins! {
13 STR_UT8_PROBLEM: "Utf8Problem" // the Utf8Problem type alias
14 STR_UT8_BYTE_PROBLEM: "Utf8ByteProblem" // the Utf8ByteProblem type alias
15 STR_TO_BYTES: "toBytes"
16 STR_USV: "Usv" imported // the Str.Usv type alias
}
4 LIST: "List" => {
0 LIST_LIST: "List" imported // the List.List type alias