lean: 2015 01
This commit is contained in:
parent
f5e7c2e487
commit
81e1d5792f
1
2015/lean/.gitignore
vendored
Normal file
1
2015/lean/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/.lake
|
3
2015/lean/Aoc2015.lean
Normal file
3
2015/lean/Aoc2015.lean
Normal 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
|
1
2015/lean/Aoc2015/Basic.lean
Normal file
1
2015/lean/Aoc2015/Basic.lean
Normal file
|
@ -0,0 +1 @@
|
|||
def hello := "world"
|
11
2015/lean/Main.lean
Normal file
11
2015/lean/Main.lean
Normal 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
1
2015/lean/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
# aoc2015
|
5
2015/lean/lake-manifest.json
Normal file
5
2015/lean/lake-manifest.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{"version": "1.0.0",
|
||||
"packagesDir": ".lake/packages",
|
||||
"packages": [],
|
||||
"name": "aoc2015",
|
||||
"lakeDir": ".lake"}
|
12
2015/lean/lakefile.lean
Normal file
12
2015/lean/lakefile.lean
Normal 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
1
2015/lean/lean-toolchain
Normal file
|
@ -0,0 +1 @@
|
|||
stable
|
Loading…
Reference in a new issue