package asli

  1. Overview
  2. Docs

Generic utility functions

val to_string : PPrintEngine.document -> string
val nub : 'a list -> 'a list
val zip_list : 'a list -> 'b list -> ('a * 'b) list
val zipWithIndex : ('a -> int -> 'b) -> 'a list -> 'b list
val isNone : 'a option -> bool
val map_option : ('a -> 'b) -> 'a option -> 'b option
val get_option : 'a option -> 'a
val from_option : 'a option -> (unit -> 'a) -> 'a
val bind_option : 'a option -> ('a -> 'b option) -> 'b option
val orelse_option : 'a option -> (unit -> 'a option) -> 'a option
val concat_option : 'a list option list -> 'a list option
val flatten_option : 'a option list -> 'a list
val flatmap_option : ('a -> 'b option) -> 'a list -> 'b list
val flatten_map_option : ('a -> 'b option) -> 'a list -> 'b list option
val first_option : ('a -> 'b option) -> 'a list -> 'b option
val startswith : string -> string -> bool

Test whether 'x' starts with (is prefixed by) 'y'

val endswith : string -> string -> bool

Test whether 'x' ends with (is suffixed by) 'y'

val stringDrop : int -> string -> string

Drop first n characters from string

OCaml

Innovation. Community. Security.