Skip to content

Commit 68e3156

Browse files
authored
Small fix to Data.String.CodePoints docs (#96)
Remove trailing whitespace, and also fix a small error in an example
1 parent 3b14477 commit 68e3156

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Data/String/CodePoints.purs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ instance showCodePoint :: Show CodePoint where
6262
-- |
6363
-- | ```purescript
6464
-- | >>> it = codePointFromInt 0x1D400 -- U+1D400 MATHEMATICAL BOLD CAPITAL A
65-
-- | Just (CodePoint 0x1D400)
65+
-- | Just (CodePoint 0x1D400)
6666
-- |
6767
-- | >>> map singleton it
6868
-- | Just "𝐀"
@@ -79,7 +79,7 @@ codePointFromInt n = Nothing
7979
-- | ```purescript
8080
-- | >>> codePointToInt (codePointFromChar 'B')
8181
-- | 66
82-
-- |
82+
-- |
8383
-- | >>> boldA = codePointFromInt 0x1D400
8484
-- | >>> boldA
8585
-- | Just (CodePoint 0x1D400)
@@ -96,7 +96,7 @@ codePointToInt (CodePoint n) = n
9696
-- | >>> codePointFromChar 'B'
9797
-- | CodePoint 0x42 -- represents 'B'
9898
-- | ```
99-
-- |
99+
-- |
100100
codePointFromChar :: Char -> CodePoint
101101
codePointFromChar = toCharCode >>> CodePoint
102102

@@ -202,7 +202,7 @@ countTail p s accum = case uncons s of
202202
-- | >>> drop 5 "𝐀𝐀 b c"
203203
-- | "b c" -- because "𝐀" occupies 2 code units
204204
-- | ```
205-
-- |
205+
-- |
206206
drop :: Int -> String -> String
207207
drop n s = String.drop (String.length (take n s)) s
208208

@@ -213,7 +213,7 @@ drop n s = String.drop (String.length (take n s)) s
213213
-- |
214214
-- | ```purescript
215215
-- | >>> dropWhile (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
216-
-- | " b c 𝐀"
216+
-- | " b c 𝐀"
217217
-- | ```
218218
-- |
219219
dropWhile :: (CodePoint -> Boolean) -> String -> String
@@ -348,7 +348,7 @@ singletonFallback (CodePoint cp) =
348348
-- | >>> splitAt 3 "b 𝐀𝐀 c 𝐀"
349349
-- | Just { before: "b 𝐀", after: "𝐀 c 𝐀" }
350350
-- | ```
351-
-- |
351+
-- |
352352
splitAt :: Int -> String -> Maybe { before :: String, after :: String }
353353
splitAt i s =
354354
let cps = toCodePointArray s in
@@ -372,7 +372,7 @@ splitAt i s =
372372
-- | >>> take 3 "b 𝐀𝐀 c 𝐀"
373373
-- | "b �"
374374
-- | ```
375-
-- |
375+
-- |
376376
take :: Int -> String -> String
377377
take = _take takeFallback
378378

@@ -391,7 +391,7 @@ takeFallback n s = case uncons s of
391391
-- |
392392
-- | ```purescript
393393
-- | >>> takeWhile (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
394-
-- | "𝐀𝐀"
394+
-- | "𝐀𝐀"
395395
-- | ```
396396
-- |
397397
takeWhile :: (CodePoint -> Boolean) -> String -> String
@@ -406,7 +406,7 @@ takeWhile p s = take (count p s) s
406406
-- | >>> codePointArray
407407
-- | [CodePoint 0x62, CodePoint 0x20, CodePoint 0x1D400, CodePoint 0x1D400]
408408
-- | >>> map singleton codePointArray
409-
-- | ["b", " ", "𝐀", "𝐀", " ", "c", " ", "𝐀"]
409+
-- | ["b", " ", "𝐀", "𝐀"]
410410
-- | ```
411411
-- |
412412
toCodePointArray :: String -> Array CodePoint

0 commit comments

Comments
 (0)