lean: 2015 01

This commit is contained in:
Maciej Jur 2024-07-24 22:51:48 +02:00
parent f5e7c2e487
commit 81e1d5792f
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
8 changed files with 35 additions and 0 deletions

1
2015/lean/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.lake

3
2015/lean/Aoc2015.lean Normal file
View file

@ -0,0 +1,3 @@
-- This module serves as the root of the `Aoc2015` library.
-- Import modules here that should be built as part of the library.
import «Aoc2015».Basic

View file

@ -0,0 +1 @@
def hello := "world"

11
2015/lean/Main.lean Normal file
View file

@ -0,0 +1,11 @@
import «Aoc2015»
def asChange : Char -> Int
| '(' => 1
| ')' => -1
| _ => 0
def main : IO Unit := do
let hello <- IO.FS.readFile "../.inputs/01.txt"
let sum := hello |> String.toList |> List.map asChange |> List.foldl (.+.) 0
IO.println sum

1
2015/lean/README.md Normal file
View file

@ -0,0 +1 @@
# aoc2015

View file

@ -0,0 +1,5 @@
{"version": "1.0.0",
"packagesDir": ".lake/packages",
"packages": [],
"name": "aoc2015",
"lakeDir": ".lake"}

12
2015/lean/lakefile.lean Normal file
View file

@ -0,0 +1,12 @@
import Lake
open Lake DSL
package «aoc2015» where
-- add package configuration options here
lean_lib «Aoc2015» where
-- add library configuration options here
@[default_target]
lean_exe «aoc2015» where
root := `Main

1
2015/lean/lean-toolchain Normal file
View file

@ -0,0 +1 @@
stable