We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cde0d26 commit 4292a8bCopy full SHA for 4292a8b
src/Data/String/CodePoints.purs
@@ -210,9 +210,9 @@ toCodePointArrayFallback :: String -> Array CodePoint
210
toCodePointArrayFallback s = unfoldr decode (fromFoldable (Char.toCharCode <$> String.toCharArray s))
211
where
212
decode :: List Int -> Maybe (Tuple CodePoint (List Int))
213
- decode (Cons h (Cons l rest)) | isLead h && isTrail l
214
- = Just (Tuple (unsurrogate h l) rest)
215
- decode (Cons c rest) = Just (Tuple (CodePoint c) rest)
+ decode (Cons cu0 (Cons cu1 rest)) | isLead cu0 && isTrail cu1
+ = Just (Tuple (unsurrogate cu0 cu1) rest)
+ decode (Cons cu rest) = Just (Tuple (CodePoint cu) rest)
216
decode Nil = Nothing
217
218
0 commit comments