···5353 Field(input.empty_field(widget), pair.second(first), transform)
5454}
55555656-pub fn list_field(
5656+pub fn indexed_enum_field(
5757 variants: List(#(String, enum)),
5858 widget: fn(Input(format), input.WidgetArgs) -> format,
5959) -> Field(format, enum) {
6060- let transform = validation.list_item(variants)
6060+ let transform = validation.enum_by_index(variants)
6161 // todo should i force this to be a non empty list?
6262 // https://github.com/giacomocavalieri/non_empty_list
6363 // on the one hand it needs to be non empty, on the other
···1313 use e <- formz.with(field("e", fields.email_field()))
1414 use f <- formz.with(field("f", fields.hidden_field()))
1515 use g <- formz.with(field("g", fields.enum_field(letters())))
1616- use h <- formz.with(field("h", fields.list_field(choices)))
1616+ use h <- formz.with(field("h", fields.indexed_enum_field(choices)))
1717+ use i <- formz.with(field("i", fields.list_field(["Dog", "Cat", "Bird"])))
17181818- formz.create_form(#(a, b, c, d, e, f, g, h))
1919+ formz.create_form(#(a, b, c, d, e, f, g, h, i))
1920}
20212122pub fn handle_get(form) {