Skip to content

Commit 0e4b35f

Browse files
comment for count
1 parent 27a5266 commit 0e4b35f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ZMidi/Internal/ParserMonad.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ module ParserMonad =
135135
Ok (Some a1, st)
136136
else Ok (None, st)
137137

138-
let count (length : int) (parser : ParserMonad<'a>) : ParserMonad<'a []> =
138+
/// Repeats a given <see paramref="parser"/> <see paramref="length"/> times.
139+
/// Fails with accumulated errors when any encountered.
140+
let count (length : int) (parser : ParserMonad<'a>) : ParserMonad<'a []> =
139141
ParserMonad <| fun input state ->
140142
let rec work (i : int)
141143
(st : State)
@@ -152,7 +154,6 @@ module ParserMonad =
152154
work length state (fun msg -> Error msg) (fun st ac -> Ok (ac, st))
153155
|> Result.map (fun (ans, st) -> (List.toArray ans, st))
154156

155-
156157
/// Drop a byte (word8)
157158
let dropByte : ParserMonad<unit> =
158159
checkedParseM "dropByte" <|

0 commit comments

Comments
 (0)