package coq-core

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

Install

Dune Dependency

Authors

Maintainers

Sources

coq-8.19.0.tar.gz
md5=64b49dbc3205477bd7517642c0b9cbb6
sha512=02fb5b4fb575af79e092492cbec6dc0d15a1d74a07f827f657a72d4e6066532630e5a6d15be4acdb73314bd40b9a321f9ea0584e0ccfe51fd3a56353bd30db9b

doc/coq-core.clib/Monad/Make/List/index.html

Module Make.ListSource

Sourceval map : ('a -> 'b t) -> 'a list -> 'b list t

List.map f l maps f on the elements of l in left to right order.

Sourceval map_right : ('a -> 'b t) -> 'a list -> 'b list t

List.map f l maps f on the elements of l in right to left order.

Sourceval fold_right : ('a -> 'b -> 'b t) -> 'a list -> 'b -> 'b t

Like the regular List.fold_right. The monadic effects are threaded right to left.

Note: many monads behave poorly with right-to-left order. For instance a failure monad would still have to traverse the whole list in order to fail and failure needs to be propagated through the rest of the list in binds which are now spurious. It is also the worst case for substitution monads (aka free monads), exposing the quadratic behaviour.

Sourceval fold_left : ('a -> 'b -> 'a t) -> 'a -> 'b list -> 'a t

Like the regular List.fold_left. The monadic effects are threaded left to right. It is tail-recursive if the (>>=) operator calls its second argument in a tail position.

Sourceval iter : ('a -> unit t) -> 'a list -> unit t

Like the regular List.iter. The monadic effects are threaded left to right. It is tail-recurisve if the >> operator calls its second argument in a tail position.

Sourceval map_filter : ('a -> 'b option t) -> 'a list -> 'b list t

Like the regular CList.map_filter. The monadic effects are threaded left to right.

Two-list iterators
Sourceval fold_left2 : 'a t -> ('a -> 'b -> 'c -> 'a t) -> 'a -> 'b list -> 'c list -> 'a t

fold_left2 r f s l1 l2 behaves like fold_left but acts simultaneously on two lists. Runs r (presumably an exception-raising computation) if both lists do not have the same length.

OCaml

Innovation. Community. Security.