Frectonz
4.03K subscribers
2.08K photos
92 videos
32 files
1.79K links
A place for me to talk about my projects, stuff i find on the internet and what I am thinking about.

By @frectonz
Download Telegram
GQL - Git Query Language

This is very cool.
🔥9
I just completed "Camel Cards" - Day 7 - Advent of Code 2023

Of course since today's puzzle was called "Camel Cards", i did it in OCaml 🐫. Determining the hand type for the cards was very difficult.

[Part 1 Solution] [Part 2 Solution]
👍2
Frectonz
I just completed "Camel Cards" - Day 7 - Advent of Code 2023 Of course since today's puzzle was called "Camel Cards", i did it in OCaml 🐫. Determining the hand type for the cards was very difficult. [Part 1 Solution] [Part 2 Solution]
OCaml supports throwing exceptions, so you don't have to carry around a Result type everywhere.

The error objects are not some opaque value that can't be inspected at the caller site, instead they are typed values that can be checked by the caller.

For example if we see the parse method on Card and we want to parse the character '1' to be the card type A (aces), we can do the following

try Card.parse '1'
with Card.UnknownCard -> Card.A;;
When thought is delegated to a principle.

[source]
Forwarded from The Beno Logs
With great power comes great responsibility.

But it also works the other way around.

With great responsibility comes great power.

The more blame you take for your life the more power you have over it.
🔥10👍5