Advent of Code 2020: Haskell Edition

Hi all,

I thought it would be fun to share my solutions so far for Advent of Code 2020, and invite anyone else to do the same!
I got this idea from the PureScript Discourse site, but I’m one of the rare folks out there who has significantly more PureScript experience than Haskell experience and I wanted to focus more on my Haskell skills right now. Hopefully we can all learn from each other by seeing how we solve some fun puzzles in different ways!

4 Likes

I’m also having fun with AOC2020, I’m solving it pretty sloppily but I wouldn’t mind publishing my solutions if it’s interesting for anyone.

btw ntwilson, I’ve noticed you defined # and <#> operators, note that in haskell these are & and <&> :slight_smile:

1 Like

Thanks gilmi,
I pulled those from PureScript, honestly :stuck_out_tongue:.
I might be missing something, but I think # and <#> are the flipped versions of $ and <$>, in the event that any expressions read easier “inside out” instead of “outside in” (when reading left-to-right).
I’d definitely love to see your solutions even if sloppy, because I bet you’ve got a lot of tricks that I’m not familiar with!

I figured :slight_smile: I’m just saying that the equivalent names for PureScript’s # and <#> in Haskell are & and <&>.

I uploaded my solutions up until now to this repo: https://gitlab.com/gilmi/aoc2020

4 Likes

I knew there was a good reason to post my solutions on discourse. Learning things already. Thanks gilmi!
(I totally misread your original response and thought you just referred me to $ and <$>)

2 Likes

Always nice to see other people’s solutions!

Since Haskell is my day job, I decided to solve the Advent of Code puzzles with Elm this year. You can see my solutions here: https://github.com/tfausak/advent-of-code-2020

2 Likes

I feel like today’s 2nd puzzle really played to one of Haskell’s strengths :slight_smile:
Uploaded my solution to my repo.

1 Like