yamleam/decoder
Bridge from YamlNode to gleam/dynamic so that the stdlib
gleam/dynamic/decode decoders work over a parsed YAML tree.
The conversion is straightforward because the Erlang term shapes
produced by dynamic.from for Gleam primitives match what the
stdlib decoders expect:
| YAML | Gleam | Erlang |
|---|---|---|
| YamlNull | Nil | nil atom |
| YamlBool | Bool | true / false atom |
| YamlInt | Int | integer |
| YamlFloat | Float | float |
| YamlString | String | binary |
| YamlList | List(Dynamic) | list |
| YamlMap | Dict(String, Dynamic) | map |
Values
pub fn to_dynamic(n: node.YamlNode) -> dynamic.Dynamic