Source

hasexp / zlist.mli

module Lazy : sig
  type 'a t
  val (!!) : 'a Lazy.t -> 'a
end

type 'a t with sexp

val nil : 'a t
val cons : 'a -> 'a t -> 'a t
val (^^) : 'a -> 'a t -> 'a t
(** Same as [cons] *)

val is_nil : 'a t -> bool

val hd : 'a t -> 'a option
val tl : 'a t -> 'a t option
val hd_tl : 'a t -> ('a * 'a t) option
(** Deconstruction *)

val npeek : 'a t -> int -> 'a list
val of_list : 'a list -> 'a t

val create : (unit -> 'a option) -> 'a t
(** Iterative creation of lazy list *)

val singleton : 'a -> 'a t
val is_singleton : 'a t -> 'a list
val map : f:('a -> 'b) -> 'a t -> 'b t
val filter : f:('a -> bool) -> 'a t -> 'a t
val filter_map : f:('a -> 'b option) -> 'a t -> 'b t
val fold_right : 
  f:('a -> 'b -> 'b) -> 'a t -> init:'b -> 'b lazy_t
val append : 'a t -> 'a t -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t

(* force functions which may loop infinite *)
val to_list : 'a t -> 'a list
val force : 'a t -> unit
val iter : f:('a -> unit) -> 'a t -> unit

module Infix : sig
  val (^^) : 'a -> 'a t -> 'a t
  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
  val (>>|) : 'a t -> ('a -> 'b) -> 'b t
end
val test : unit -> unit
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.