package reason-standard

  1. Overview
  2. Docs

Construct sets of Strings

type nonrec t = (string, Standard__.Core.String.identity) t
val empty : t

A set with nothing in it.

val singleton : string -> t

Create a set of a single String

Examples

Set.String.singleton "Bat" |> Set.toList = ["Bat"]
val ofArray : string array -> t

Create a set from an Array

Examples

Set.String.ofArray [|"a";"b";"g";"b";"g";"a";"a"|] |> Set.toArray = [|"a";"b";"g"|]
val ofList : string list -> t

Create a set from a List

Examples

Set.String.ofList [|"a";"b";"g";"b";"g";"a";"a"|] |> Set.toList = ["a";"b";"g"]
OCaml

Innovation. Community. Security.