gleam/erlang/charlist

A charlist is a list of integers where all the integers are valid code points.

In practice, you will not come across them often, except perhaps when interfacing with Erlang, in particular when using older libraries that do not accept binaries as arguments.

Types

A list of characters represented as ints. Commonly used with Erlang functions that do not accept binary strings such as Gleam’s core string type.

pub type Charlist

Values

pub fn from_string(a: String) -> Charlist

Convert a string to a charlist using Erlang’s unicode:characters_to_list.

pub fn to_string(a: Charlist) -> String

Convert a charlist to a string using Erlang’s unicode:characters_to_binary.

Search Document