beamtalk-yaml

July 11, 2026 ยท View on GitHub

YAML parsing and generation library for Beamtalk.

Built on yamerl (pure Erlang, no NIFs).

Installation

Add the dependency to your beamtalk.toml:

[dependencies]
yaml = "0.1.0"

Then run:

beamtalk build

Usage

Parsing

(Yaml parse: "answer: 42") unwrap           // => #{"answer" => 42}
(Yaml parse: "[1, 2, 3]") unwrap            // => #(1, 2, 3)
(Yaml parse: "null") unwrap                 // => nil

Multi-document parsing

\n inside a "..." literal is not a newline escape in Beamtalk โ€” build a real newline with $\n asString (see below) to separate documents with ---.

nl := $\n asString
(Yaml parseAll: "42" ++ nl ++ "---" ++ nl ++ "43") unwrap   // => #(42, 43)

Generation

Yaml generate: #{"name" => "Ada"}           // => {"name": "Ada"}
Yaml generate: #(1, 2, 3)                   // => [1, 2, 3]
Yaml generate: nil                          // => null

File parsing

(Yaml parseFile: "config.yaml") unwrap

Type Mapping

YAMLBeamtalk
mappingDictionary
sequenceList
stringString
integerInteger
floatFloat
true/falseBoolean
null/~nil

Classes

ClassDescription
YamlClass methods for parsing and generating YAML strings

Development

just build    # Build the package
just test     # Run tests
just fmt      # Check formatting
just ci       # Full CI check (fmt + lint + build + test)

License

Apache-2.0 -- Copyright 2026 James Casey