Skip to content

Instantly share code, notes, and snippets.

@theburningmonk
theburningmonk / elm_extend_records.elm
Last active December 24, 2023 17:16
Extending Elm records
-- Extensible Records
-- given a record
x = { age = 42, name = "Boke" }
-- you can clone and remove a field in the process
{ x - age } -- { name = "Boke" }
-- you can also add a field
{ x | species = "Jade Dragon" } -- { age = 42, name = "Boke", species = "Jade Dragon" }