-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sfh][2023] Day 1 (OCaml/Reason) #120
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
esy.lock/* linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.merlin | ||
.DS_Store | ||
node_modules/ | ||
_build | ||
_esy | ||
_release | ||
*.byte | ||
*.native | ||
*.install | ||
inputs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"[dune]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[reason]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"ocaml.sandbox": { | ||
"kind": "esy", | ||
"root": "${workspaceFolder:2023}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# AOC Reason | ||
|
||
## Install Deps | ||
|
||
$ esy | ||
|
||
This is an alias for `esy install` or `esy i`. | ||
|
||
## Build | ||
|
||
$ esy b | ||
|
||
`b` is an alias for `esy build`. | ||
|
||
## Run | ||
|
||
$ esy x aoc | ||
|
||
`x` is an alias for `esy exec`. | ||
|
||
## Watch | ||
|
||
$ npm run build:watch | ||
|
||
## Test | ||
|
||
$ npm run test | ||
$ npm run test:watch | ||
|
||
**Note**: Only one dune process can be run at a time (it locks the build directory), so you must stop the watch process before running tests. | ||
|
||
## Notes/Questions | ||
|
||
- [ ] Can `esy` be used with `asdf-ocaml` in a sensible way? | ||
- [ ] `esy` has it's own project sandboxing (like `opam` switches, but project-specific by default) | ||
|
||
## References | ||
|
||
- https://www.chrisarmstrong.dev/posts/setting-up-a-new-reason-project | ||
- https://mukulrathi.com/ocaml-tooling-dune/ | ||
- https://reasonml.github.io/en/try.html | ||
- https://github.com/fangyi-zhou/advent-of-code-ocaml-starter/tree/main | ||
- https://github.com/fangyi-zhou/advent-of-code/tree/main/2022 | ||
- https://github.com/DrearyLisper/aoc-2022 | ||
- https://ocaml.org/docs | ||
- https://reasonml.github.io/docs/en/overview | ||
- https://dune.readthedocs.io/en/stable/index.html | ||
- https://esy.sh/docs/getting-started/ | ||
- https://github.com/janestreet/ppx_inline_test/tree/master | ||
- https://discuss.ocaml.org/t/how-to-set-up-unit-testing-in-2023/12682/26 | ||
- https://discuss.ocaml.org/t/ocaml-stdlib-and-death-by-a-thousand-papercuts/9180/9 | ||
- https://c-cube.github.io/ocaml-containers/last/containers/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" {>= "3.11"} | ||
"odoc" {with-doc} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(executable | ||
(name main) | ||
(public_name aoc) | ||
(libraries aoc)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
open Aoc; | ||
|
||
let () = { | ||
Day1.run(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(lang dune 3.11) | ||
(name aoc) | ||
(generate_opam_files true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "aoc-2023", | ||
"dependencies": { | ||
"@opam/containers": "3.12", | ||
"@opam/dune": ">= 3.8.0", | ||
"@opam/reason": "*", | ||
"ocaml": "5.1.4" | ||
}, | ||
"devDependencies": { | ||
"@opam/merlin": "*", | ||
"@opam/ocaml-lsp-server": "*", | ||
"@opam/ocamlformat": "*", | ||
"@opam/ppx_assert": "*", | ||
"@opam/ppx_compare": "v0.16.0", | ||
"@opam/ppx_expect": "v0.16.0", | ||
"@opam/ppx_inline_test": "*", | ||
"@opam/ppx_sexp_conv": "v0.16.0", | ||
"@opam/sexplib": "v0.16.0", | ||
"@opam/utop": "*" | ||
}, | ||
"esy": { "buildsInSource": "_build", "build": [ "dune build -p aoc" ] }, | ||
"scripts": { "build:watch": "dune build -w -p aoc" }, | ||
"installConfig": { "pnp": false } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these
esy.lock/
meant to be committed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that they should be committed (like
package-lock.json
, but more verbose). The docs on esy.sh mention it here. Also, this starter repo doesn't omit them.