I’ve seen Richard mention for_each in the aoc markdown, so I’ve tried to write the following:
printbis! = |msg| msg.split_on("\n").for_each!(Stdout.line!)
And I’m getting the following error:
This for_each! method is being called on a value whose type doesn't have that method:
┌─ day01.roc:24:38
│
24 │ printbis! = |msg| msg.split_on("\n").for_each!(Stdout.line!)
│ ^^^^^^^^^
The value's type, which does not have a method named for_each!, is:
List(Str)
Is this truly just a missing implementation, or is there something else happening here?
Yeah for_each doesn't exist on List
Here are all the implemented builtins
https://github.com/roc-lang/roc/blob/5e229e2060c839a195fb44266925c0c479d6309d/src/build/roc/Builtin.roc
PR for List.for_each! https://github.com/roc-lang/roc/pull/8531
Last updated: Dec 21 2025 at 12:15 UTC