package coq-core

  1. Overview
  2. Docs
The Coq Proof Assistant -- Core Binaries and Tools

Install

Dune Dependency

Authors

Maintainers

Sources

coq-8.20.1.tar.gz
md5=0cfaa70f569be9494d24c829e6555d46
sha512=8ee967c636b67b22a4f34115871d8f9b9114df309afc9ddf5f61275251088c6e21f6cf745811df75554d30f4cebb6682f23eeb2e88b771330c4b60ce3f6bf5e2

doc/coq-core.gramlib/Gramlib/LStream/index.html

Module Gramlib.LStreamSource

Extending streams with a (non-canonical) location function

Sourcetype ('e, 'a) t
Sourceval from : ?loc:Loc.t -> ('e -> ('a * Loc.t) option) -> ('e, 'a) t
Sourceval current_loc : ('e, 'a) t -> Loc.t

Returning the loc of the last consumed element or the initial loc if no element is consumed

Sourceval max_peek_loc : ('e, 'a) t -> Loc.t

Returning the loc of the max visited element or the initial loc if no element is consumed

Sourceval interval_loc : int -> int -> ('e, 'a) t -> Loc.t

interval_loc bp ep strm returns the loc starting after element bp (counting from 0) and spanning up to already peeked element at position ep, under the assumption that bp <= ep; returns an empty interval if bp = ep; returns the empty initial interval if additionally bp = 0; fails if the elements have not been peeked yet

Sourceval get_loc : int -> ('e, 'a) t -> Loc.t

Return location of an already peeked element at some position counting from 0; fails if the element has not been peeked yet

Lifted usual function on streams

Sourceval count : ('e, 'a) t -> int
Sourceval peek : 'e -> ('e, 'a) t -> 'a option
Sourceval npeek : 'e -> int -> ('e, 'a) t -> 'a list
Sourceval junk : 'e -> ('e, 'a) t -> unit

consumes the next element if there is one

Sourceval njunk : 'e -> int -> ('e, 'a) t -> unit

njunk e n strm consumes n elements from strm

Sourceval next : 'e -> ('e, 'a) t -> 'a

next e strm returns and consumes the next element; raise Stream.Failure if the stream is empty

Other functions

Sourceval peek_nth : 'e -> int -> ('e, 'a) t -> 'a

peek_nth e n strm returns the nth element counting from 0 without consuming the stream; raises Stream.Failure if not enough elements

OCaml

Innovation. Community. Security.