I just realized it'd be possible to use the "record builder" syntax @Agus Zubiaga recently implemented to implement a generator for sequential unique IDs - something like this:
{ foo, bar, baz } = Count.from 0 {
foo: <- Count.inc, # increment by 1
bar: <- Count.inc,
baz: <- Count.inc,
} |> Count.done
I did something similar in Elm a long time ago
basically this is a way to avoid doing like:
foo = 0
bar = 1
baz = 2
...and then having to manually keep them all sequential, check for duplicates, etc.
you could also replace Count.inc with a custom function which (for example) wraps the number in an opaque type like MyId or whatever
or transforms it however you like
Last updated: Jun 16 2026 at 16:19 UTC