Opaques take @ : %s/\$\([A-Z]\)/@\1/g

This commit is contained in:
Ayaz Hafiz 2022-04-25 12:26:38 -04:00
parent e43994530f
commit f1dc9c8298
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
20 changed files with 201 additions and 206 deletions

View file

@ -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 ]*

View file

@ -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 ]*