From 6c661db5b3e167d45554f7c5e4838dbc3bffa63a Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Thu, 2 Mar 2023 21:40:59 +0100 Subject: Refactor using constructs from Gleam v0.27 --- aoc-2020-gleam/src/days/day04.gleam | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'aoc-2020-gleam/src/days/day04.gleam') diff --git a/aoc-2020-gleam/src/days/day04.gleam b/aoc-2020-gleam/src/days/day04.gleam index 21998e2..305cfa1 100644 --- a/aoc-2020-gleam/src/days/day04.gleam +++ b/aoc-2020-gleam/src/days/day04.gleam @@ -4,6 +4,7 @@ import gleam/function as fun import gleam/result as res import gleam/map.{Map} import ext/listx +import ext/intx import ext/resultx as resx import util/input_util import util/parser as p @@ -61,7 +62,7 @@ fn is_valid1(passport: Passport) -> Bool { fn is_valid2(passport: Passport) -> Bool { let int_between = fn(min, max) { p.int() - |> p.satisfying(rule: fn(num) { min <= num && num <= max }) + |> p.satisfying(rule: intx.is_between(_, min, and: max)) |> p.ignore } -- cgit v1.2.3