this post was submitted on 01 Dec 2024
2 points (100.0% liked)
Advent of Code
295 readers
1 users here now
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
#FSharp
https://github.com/isti115/advent-of-code/tree/master/2024/day-01I usually choose to learn a new language each year using these great little puzzles, this time it's FSharp. This naturally means that my solutions will be poorly written at first, since I'm not yet familiar with the language and make do with what I have. For example I'm pretty sure that there should be a better way to parse today's input instead of this monstrosity:
~~Also, I was pretty surprised that I couldn't find the
unzip
function for sequences. I would've expected that to be present after using some other functional languages, such as Haskell and Scala. ๐ค~~Edit: Scratch that, I just need to convert the sequence into a list first... ๐คฆโโ๏ธ It actually makes complete sense. https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#unzip Also, I have managed to clean up the parsing a little bit.