At some point I should document or write a script for how I package Elm projects
with Nix to be deployed on my website. For now, I'm modeling everything after my
previous success LearnPianoChords.
Creating a simple HTTP RESTful API for exposing our `Server.semiprime`
function. It supports some help messages, primitive parsing and error handling,
and singular vs. batch processing of arguments.
For more sophisticated parsing and error-checking, I prefer to use Haskell's
Servant library.
- Clear the boilerplate that `mix` generated
- Consume `Math.factor` to test which inputs are semiprimes
- Cache all inputs that are semiprimes as soon as we discover that they are
- semiprimes
I considered a couple things related to the Cache:
- Could save space by storing all semiprime factors in a tree. This would make
the lookups more expensive. Also because the tree's depth would never exceed
two (because all semiprimes only have two factors), the tree would be quite
broad, and we may not be saving enough space for the trade to be worthwhile. I
might be wrong about that though.
- We could consider pre-computing all semiprimes when we start the app, but
without running some tests firsts, I'm not sure whether or not it's worth the
trouble.
Define a simple in-memory key-value store for our cache.
TL;DR:
- Define `Cache` as a simple state-keeping `Agent`
- Define `Sup`, which starts our Cache process
- Define `App`, which starts our Supervisor process
- Whitelist `App` in `mix.exs`, so that it starts after calling `iex -S mix`
In case I want to package this project with Nix. For now, it's useful to store
this at the project root because it help my Emacs's `project-find-file`
function.
This is a step towards making the completing-read framework more
easily interchangeable (I'm eyeing selectrum).
Change-Id: I7a066e212a5384136defbba8f11ef9ed57abf22e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2240
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
I'm too tired for part 2.
Change-Id: Ic7058344806466276e3792e9ff9bbf660a18f672
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2239
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Solve time is like 36 hours, that must be a record!
Change-Id: I3713f033d83e6179a5d5fa7513952ee3864a6164
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2238
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This lets the parser collect multiple errors instead of returning
after the first one, with some optimistic synchronisation after
encountering something that looks wonky.
Change-Id: Ie9d0ce8de9dcc7a3d1e7aa2abe15f74cab0ab96b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2236
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
... with the exception of parenthesised expressions, because error
threading is not implemented yet.
Change-Id: I8d455d85e647548d5b71cbfd3d078f4970dab7fb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2232
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This changes the structure of the output, too, where all AoC solutions
now end up in a big folder with `bin/day$n` executables.
Change-Id: I77928f4129489d06779b50059835925652688c9c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2231
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
... found this in the same place as hanebuschtag.txt
Change-Id: Iff5f4867b6c1d7685edae8a190489f3efb4890bc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2229
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This old, legendary file should never be lost.
Change-Id: I2ae1607da24d684199c4136a880f56528d45a6e8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2228
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Something I changed - perhaps removing lib.mkOptionDefault - caused
the *default* i3 keybindings (things like switching workspaces and
toggling the split layout which I had not added myself) not to get
added. This adds them back.
Change-Id: I301a346eabb4f7fc4499b60a4c26956fb1e08b0d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2218
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
This actually appears to be working this time!
Change-Id: I3e10eb7e1621a050e024b8b53313f13d44a999ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2217
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI