diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2023-02-21 19:46:12 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2023-02-21 19:46:12 +0100 |
commit | 16509ecd4f31ef421a464a98c8e0ea73bb5cb111 (patch) | |
tree | 7ac2145ed18cf868abe0b877fecb5988d11fd2ac /aoc-2020-gleam/src/util/input_util.gleam | |
parent | 9c94df2676e8b857eac6c94e827086bf0e8cb850 (diff) | |
download | gleam_aoc2020-16509ecd4f31ef421a464a98c8e0ea73bb5cb111.tar.gz gleam_aoc2020-16509ecd4f31ef421a464a98c8e0ea73bb5cb111.zip |
Refactor previous days
Diffstat (limited to 'aoc-2020-gleam/src/util/input_util.gleam')
-rw-r--r-- | aoc-2020-gleam/src/util/input_util.gleam | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/aoc-2020-gleam/src/util/input_util.gleam b/aoc-2020-gleam/src/util/input_util.gleam index 3e6b076..2589a7d 100644 --- a/aoc-2020-gleam/src/util/input_util.gleam +++ b/aoc-2020-gleam/src/util/input_util.gleam @@ -1,8 +1,9 @@ import gleam/list import gleam/string +import gleam/function +import gleam/bool import gleam/erlang/file import ext/intx -import ext/stringx import ext/resultx pub fn read_text(filename: String) -> String { @@ -16,7 +17,7 @@ pub fn read_lines(filename: String) -> List(String) { |> read_text() |> string.split(on: "\n") |> list.map(with: string.trim) - |> list.filter(for: stringx.is_not_empty) + |> list.filter(for: function.compose(string.is_empty, bool.negate)) } pub fn read_numbers(filename: String) -> List(Int) { |