@@ -62,7 +62,7 @@ instance showCodePoint :: Show CodePoint where
62
62
-- |
63
63
-- | ```purescript
64
64
-- | >>> it = codePointFromInt 0x1D400 -- U+1D400 MATHEMATICAL BOLD CAPITAL A
65
- -- | Just (CodePoint 0x1D400)
65
+ -- | Just (CodePoint 0x1D400)
66
66
-- |
67
67
-- | >>> map singleton it
68
68
-- | Just "𝐀"
@@ -79,7 +79,7 @@ codePointFromInt n = Nothing
79
79
-- | ```purescript
80
80
-- | >>> codePointToInt (codePointFromChar 'B')
81
81
-- | 66
82
- -- |
82
+ -- |
83
83
-- | >>> boldA = codePointFromInt 0x1D400
84
84
-- | >>> boldA
85
85
-- | Just (CodePoint 0x1D400)
@@ -96,7 +96,7 @@ codePointToInt (CodePoint n) = n
96
96
-- | >>> codePointFromChar 'B'
97
97
-- | CodePoint 0x42 -- represents 'B'
98
98
-- | ```
99
- -- |
99
+ -- |
100
100
codePointFromChar :: Char -> CodePoint
101
101
codePointFromChar = toCharCode >>> CodePoint
102
102
@@ -202,7 +202,7 @@ countTail p s accum = case uncons s of
202
202
-- | >>> drop 5 "𝐀𝐀 b c"
203
203
-- | "b c" -- because "𝐀" occupies 2 code units
204
204
-- | ```
205
- -- |
205
+ -- |
206
206
drop :: Int -> String -> String
207
207
drop n s = String .drop (String .length (take n s)) s
208
208
@@ -213,7 +213,7 @@ drop n s = String.drop (String.length (take n s)) s
213
213
-- |
214
214
-- | ```purescript
215
215
-- | >>> dropWhile (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
216
- -- | " b c 𝐀"
216
+ -- | " b c 𝐀"
217
217
-- | ```
218
218
-- |
219
219
dropWhile :: (CodePoint -> Boolean ) -> String -> String
@@ -348,7 +348,7 @@ singletonFallback (CodePoint cp) =
348
348
-- | >>> splitAt 3 "b 𝐀𝐀 c 𝐀"
349
349
-- | Just { before: "b 𝐀", after: "𝐀 c 𝐀" }
350
350
-- | ```
351
- -- |
351
+ -- |
352
352
splitAt :: Int -> String -> Maybe { before :: String , after :: String }
353
353
splitAt i s =
354
354
let cps = toCodePointArray s in
@@ -372,7 +372,7 @@ splitAt i s =
372
372
-- | >>> take 3 "b 𝐀𝐀 c 𝐀"
373
373
-- | "b �"
374
374
-- | ```
375
- -- |
375
+ -- |
376
376
take :: Int -> String -> String
377
377
take = _take takeFallback
378
378
@@ -391,7 +391,7 @@ takeFallback n s = case uncons s of
391
391
-- |
392
392
-- | ```purescript
393
393
-- | >>> takeWhile (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
394
- -- | "𝐀𝐀"
394
+ -- | "𝐀𝐀"
395
395
-- | ```
396
396
-- |
397
397
takeWhile :: (CodePoint -> Boolean ) -> String -> String
@@ -406,7 +406,7 @@ takeWhile p s = take (count p s) s
406
406
-- | >>> codePointArray
407
407
-- | [CodePoint 0x62, CodePoint 0x20, CodePoint 0x1D400, CodePoint 0x1D400]
408
408
-- | >>> map singleton codePointArray
409
- -- | ["b", " ", "𝐀", "𝐀", " ", "c", " ", "𝐀"]
409
+ -- | ["b", " ", "𝐀", "𝐀"]
410
410
-- | ```
411
411
-- |
412
412
toCodePointArray :: String -> Array CodePoint
0 commit comments