mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Opaques take @ : %s/\$\([A-Z]\)/@\1/g
This commit is contained in:
parent
e43994530f
commit
f1dc9c8298
20 changed files with 201 additions and 206 deletions
|
@ -13,9 +13,9 @@ interface Unicode.CodePoint.Internal
|
|||
CodePoint := U32
|
||||
|
||||
fromU32Unchecked : U32 -> CodePoint
|
||||
fromU32Unchecked = \u32 -> $CodePoint u32
|
||||
fromU32Unchecked = \u32 -> @CodePoint u32
|
||||
|
||||
toU32 : CodePoint -> U32
|
||||
toU32 = \$CodePoint u32 -> u32
|
||||
toU32 = \@CodePoint u32 -> u32
|
||||
|
||||
fromU32 : U32 -> Result CodePoint [ BadCodePoint ]*
|
||||
|
|
|
@ -21,7 +21,7 @@ interface Unicode.Scalar
|
|||
Scalar := U32
|
||||
|
||||
toStr : Scalar -> Str
|
||||
toStr = \$Scalar u32
|
||||
toStr = \@Scalar u32
|
||||
when Str.fromScalar u32 is
|
||||
Ok str -> str
|
||||
Err _ ->
|
||||
|
@ -29,10 +29,10 @@ toStr = \$Scalar u32
|
|||
# this Err branch will never run. That's because it only runs
|
||||
# if Str.fromScalar receives an invalid scalar value, and we've
|
||||
# already validated this!
|
||||
toStr ($Scalar (scalar * 256))
|
||||
toStr (@Scalar (scalar * 256))
|
||||
|
||||
toCodePt : Scalar -> CodePt
|
||||
toCodePt = \$Scalar u32 -> Internal.fromU32Unchecked u32
|
||||
toCodePt = \@Scalar u32 -> Internal.fromU32Unchecked u32
|
||||
|
||||
fromCodePt : CodePt -> Result Scalar [ PointWasSurrogate ]*
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue