Syrup format encoder and decoder
Find a file
2026-03-14 19:13:45 -03:00
src constructors and single module lib 2026-03-14 19:13:45 -03:00
test constructors and single module lib 2026-03-14 19:13:45 -03:00
.gitignore initial commit 2026-03-14 16:26:13 -03:00
gleam.toml constructors and single module lib 2026-03-14 19:13:45 -03:00
LICENSE initial commit 2026-03-14 16:26:13 -03:00
manifest.toml initial commit 2026-03-14 16:26:13 -03:00
README.md constructors and single module lib 2026-03-14 19:13:45 -03:00
zoo.bin initial commit 2026-03-14 16:26:13 -03:00

gleerup

Simple Syrup encoder and decoder for Gleam.

Package Version Hex Docs

gleam add gleerup
import gleerup

pub fn main() -> Nil {
  let input = <<"{3\"age30+4\"name5\"Alice7\"another[1+2+3+]7\"isAlivet}">>
  let result = gleerup.decode(input) |> default_value

  assert gleerup.dictionary(
      dict.from_list([
        #(gleerup.str("age"), gleerup.int(30)),
        #(gleerup.str("name"), gleerup.str("Alice")),
        #(
          gleerup.str("another"),
          gleerup.sequence([
            gleerup.int(1),
            gleerup.int(2),
            gleerup.int(3),
          ]),
        ),
        #(gleerup.str("isAlive"), gleerup.bool(True)),
      ]),
    )
    == result
}

Further documentation can be found at https://hexdocs.pm/gleerup.

Development

gleam run   # Run the project
gleam test  # Run the tests