gleerup

Types

pub type Value {
  Boolean(Bool)
  Float(Float)
  Double(Float)
  PositiveInteger(Int)
  NegativeInteger(Int)
  Binary(BitArray)
  String(String)
  Symbol(String)
  Dictionary(dict.Dict(Value, Value))
  Sequence(List(Value))
  Record(tag: Value, values: List(Value))
  Set(set.Set(Value))
}

Constructors

  • Boolean(Bool)
  • Float(Float)
  • Double(Float)
  • PositiveInteger(Int)
  • NegativeInteger(Int)
  • Binary(BitArray)
  • String(String)
  • Symbol(String)
  • Dictionary(dict.Dict(Value, Value))
  • Sequence(List(Value))
  • Record(tag: Value, values: List(Value))
  • Set(set.Set(Value))

Values

pub fn binary(x: BitArray) -> Value
pub fn bool(x: Bool) -> Value
pub fn decode(input: BitArray) -> Result(Value, Nil)

decode Syrup binary data. assumes canonical form.

pub fn dictionary(x: dict.Dict(Value, Value)) -> Value
pub fn double(x: Float) -> Value
pub fn encode(value: Value) -> BitArray

encode Syrup data in canonical form.

pub fn float(x: Float) -> Value
pub fn int(x: Int) -> Value
pub fn is_atom(x: Value) -> Bool
pub fn is_compound(x: Value) -> Bool
pub fn record(
  label: Value,
  fields: List(Value),
) -> Result(Value, Nil)
pub fn sequence(x: List(Value)) -> Value
pub fn set(x: set.Set(Value)) -> Value
pub fn str(x: String) -> Value
pub fn symbol(x: String) -> Value
Search Document