tweak to day3

This commit is contained in:
2024-12-03 16:36:52 -08:00
parent 4d67db9fe4
commit 47657090c1
5 changed files with 11 additions and 7 deletions

View File

@@ -4,17 +4,12 @@ import Prelude
import Node
import Aoc
uncurry : a b c. (a -> b -> c) -> (a × b) -> c
uncurry f (a,b) = f a b
Parser : U U
Parser a = List Char Maybe (a × List Char)
instance Monad Parser where
pure a = \ cs => Just (a, cs)
bind ma mab = \ cs => case ma cs of
Nothing => Nothing
Just (a,cs) => mab a cs
bind ma mab = \ cs => ma cs >>= uncurry mab
instance Alternative Parser where
pa <|> pb = \ cs => case pa cs of

1
aoc2024/Node.newt Symbolic link
View File

@@ -0,0 +1 @@
../aoc2023/Node.newt

1
aoc2024/Prelude.newt Symbolic link
View File

@@ -0,0 +1 @@
../aoc2023/Prelude.newt