argamak/util

Types

An error type for utility functions.

pub type UtilError {
  InvalidRecord
}

Constructors

  • InvalidRecord

Functions

pub fn record_to_string(record: a) -> Result(String, UtilError)

Results in a String converted from a custom type record’s name on success, or a UtilError on failure.

Examples

> type Axis { X }
> record_to_string(X)
Ok("X")

> record_to_string(3)
Error(InvalidRecord)