mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Remove private tags from unicode package
This commit is contained in:
parent
be56cdf782
commit
ee30b85430
2 changed files with 7 additions and 7 deletions
|
@ -10,12 +10,12 @@ interface Unicode.CodePoint.Internal
|
||||||
[]
|
[]
|
||||||
|
|
||||||
## This is just here so that both Unicode.Scalar and Unicode.CodePoint can access it.
|
## This is just here so that both Unicode.Scalar and Unicode.CodePoint can access it.
|
||||||
CodePoint : [ @CodePoint U32 ]
|
CodePoint := U32
|
||||||
|
|
||||||
fromU32Unchecked : U32 -> CodePoint
|
fromU32Unchecked : U32 -> CodePoint
|
||||||
fromU32Unchecked = \u32 -> @CodePoint u32
|
fromU32Unchecked = \u32 -> $CodePoint u32
|
||||||
|
|
||||||
toU32 : CodePoint -> U32
|
toU32 : CodePoint -> U32
|
||||||
toU32 = \@CodePoint u32 -> u32
|
toU32 = \$CodePoint u32 -> u32
|
||||||
|
|
||||||
fromU32 : U32 -> Result CodePoint [ BadCodePoint ]*
|
fromU32 : U32 -> Result CodePoint [ BadCodePoint ]*
|
||||||
|
|
|
@ -18,10 +18,10 @@ interface Unicode.Scalar
|
||||||
]
|
]
|
||||||
|
|
||||||
## A [Unicode Scalar Value](http://www.unicode.org/glossary/#unicode_scalar_value)
|
## A [Unicode Scalar Value](http://www.unicode.org/glossary/#unicode_scalar_value)
|
||||||
Scalar : [ @Scalar U32 ]
|
Scalar := U32
|
||||||
|
|
||||||
toStr : Scalar -> Str
|
toStr : Scalar -> Str
|
||||||
toStr = \@Scalar u32
|
toStr = \$Scalar u32
|
||||||
when Str.fromScalar u32 is
|
when Str.fromScalar u32 is
|
||||||
Ok str -> str
|
Ok str -> str
|
||||||
Err _ ->
|
Err _ ->
|
||||||
|
@ -29,10 +29,10 @@ toStr = \@Scalar u32
|
||||||
# this Err branch will never run. That's because it only runs
|
# this Err branch will never run. That's because it only runs
|
||||||
# if Str.fromScalar receives an invalid scalar value, and we've
|
# if Str.fromScalar receives an invalid scalar value, and we've
|
||||||
# already validated this!
|
# already validated this!
|
||||||
toStr (@Scalar (scalar * 256))
|
toStr ($Scalar (scalar * 256))
|
||||||
|
|
||||||
toCodePt : Scalar -> CodePt
|
toCodePt : Scalar -> CodePt
|
||||||
toCodePt = \@Scalar u32 -> Internal.fromU32Unchecked u32
|
toCodePt = \$Scalar u32 -> Internal.fromU32Unchecked u32
|
||||||
|
|
||||||
fromCodePt : CodePt -> Result Scalar [ PointWasSurrogate ]*
|
fromCodePt : CodePt -> Result Scalar [ PointWasSurrogate ]*
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue