fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 197: Get a list of lines from a file
Idiom # 197: Get a list of lines from a file
See
programming-idioms.org
:
Code
Code input
# NYI UNDER DEVELOPMENT: we need a more succinct way to do things like this lines := io.file.read path .bind (.split "\n")
What are effects?
Runnable Example
Code input
ex197 is path := path.of "path/to/file" lines := io.file.read path .bind (.split "\n") match lines l Sequence String => say l # logic in case of success err error => say err # error handling logic
What are effects?
last changed: 2026-02-20
next: Idiom # 198: Abort program execution with error condition