Language tour

24 exercises from the Gleam track on exercism, solved in Bea, then a chapter on records, else guards, deriving and testing. Each lesson shows the Bea code, the Gleam it compiles to, and what it prints. Start at the top if Bea is new to you; every lesson builds on the last.

Start with Hello, World!

  1. 1First steps

    1. Hello, World!def, echo
    2. Lasagnafunctions, Int, type annotations
    3. Pac-Man rulesBool, and / or / not, imports
    4. Betty's bike shopFloat, pipes, interpolation
  2. 2Making decisions

    1. Guessing gamereturn, cond, case, guards
    2. Tisbury treasure hunttuples, anonymous functions
    3. Tracks on tracks on trackslists, multi-clause functions
    4. Log levelsstrings, destructuring
  3. 3Your own types

    1. Valentine's daycustom types, case, guards
    2. Bandwagonerrecords, record update, label shorthand
    3. Bird countrecursion, clause guards
    4. Pizza pricingrecursive types, maps, ?
  4. 4Functions as values

    1. Secretsclosures, function types
    2. High school sweetheartstring functions, multi-line strings
    3. Treasure chestgenerics, cond
    4. GoResult, result.try, record update
  5. 5Collections

    1. High score boarddicts, type aliases, Option
    2. Weather rankingmulti-clause on several arguments, Order
    3. Wine cellarlabelled arguments, guards on fields
    4. Gotta snatch 'em allsets, early return, patterns in clause heads
  6. 6Patterns all the way down

    1. Role playing gamepartial record patterns, as, Option
    2. Spring cleaninglet assert, string prefix patterns
    3. DNA encodingbit arrays, binary literals
    4. Newsletter?, Hex packages, files
  7. 7Records, guards and deriving

    1. Recordstype T { … }, generic records, record update
    2. Else guardselse, pattern guards, ?, use
    3. Deriving@derive, derivers, JSON
    4. Functions through their typeType.name(), hand-written decoders
    5. Testingbea test, gleeunit, bea pack