Gramlib.LStreamExtending streams with a (non-canonical) location function
Returning the loc of the last consumed element or the initial loc if no element is consumed
Returning the loc of the max visited element or the initial loc if no element is consumed
Return location of an already peeked element at some position counting from count; fails if the element has not been peeked yet. That is, get_loc 0 s is the first location after current_loc. The position must be positive.
Lifted usual function on streams
val count : ('e, 'a) t -> intval peek : 'e -> ('e, 'a) t -> 'a optionval npeek : 'e -> int -> ('e, 'a) t -> 'a listval junk : 'e -> ('e, 'a) t -> unitconsumes the next element if there is one
val njunk : 'e -> int -> ('e, 'a) t -> unitnjunk e n strm consumes n elements from strm
val next : 'e -> ('e, 'a) t -> 'a optionnext e strm returns and consumes the next element; None if the stream is empty
Other functions
val peek_nth : 'e -> int -> ('e, 'a) t -> 'a optionpeek_nth e n strm returns the nth element counting from 0 without consuming the stream; None if not enough elements
Position manipulation. Internal.
val pos_offset : position -> int