Ep 15: Advent of Code 2021 Day 1. Is it Traverse?
If you're new to this series I make videos about functional programming, category theory, Scala, Haskell, Lisp and other functional languages.
Often I hear a joke from functional programmers (at least in Scala) is that "it's always Traverse". Traverse is a Swiss army knife, able to solve many problems. But can it solve the first Advent of Code problem of the year? Let's find out!
Thanks to Philip Schwarz for a Twitter exchange where I realized the Monoid instance in the video has a bug in that in relies on zero values being only first and last when doing the applicative traverse. That's not an assumption you can make, and I have since fixed the code in the repository so that it now works with Typelevel's Cats library too, which inserts zero values in the middle of the list.
Advent of Code
https://adventofcode.com/2021/day/1
Scalaz:
https://github.com/scalaz/scalaz
Check out my programming blog:
http://justinhj.github.io/
Check out the code for this video here:
https://github.com/justinhj/adventofcode2021-day1
Program code and tutorial content by me
Video editing by Jamie Heyes-Jones
Intro music "Functional Justin Intro 1" by me
©2020-2021 Justin Heyes-Jones. All Rights Reserved
Видео Ep 15: Advent of Code 2021 Day 1. Is it Traverse? канала Functional Justin
Often I hear a joke from functional programmers (at least in Scala) is that "it's always Traverse". Traverse is a Swiss army knife, able to solve many problems. But can it solve the first Advent of Code problem of the year? Let's find out!
Thanks to Philip Schwarz for a Twitter exchange where I realized the Monoid instance in the video has a bug in that in relies on zero values being only first and last when doing the applicative traverse. That's not an assumption you can make, and I have since fixed the code in the repository so that it now works with Typelevel's Cats library too, which inserts zero values in the middle of the list.
Advent of Code
https://adventofcode.com/2021/day/1
Scalaz:
https://github.com/scalaz/scalaz
Check out my programming blog:
http://justinhj.github.io/
Check out the code for this video here:
https://github.com/justinhj/adventofcode2021-day1
Program code and tutorial content by me
Video editing by Jamie Heyes-Jones
Intro music "Functional Justin Intro 1" by me
©2020-2021 Justin Heyes-Jones. All Rights Reserved
Видео Ep 15: Advent of Code 2021 Day 1. Is it Traverse? канала Functional Justin
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Ep 11: Search Hacker News with ZIO and magic](https://i.ytimg.com/vi/3P2Gi--dG9A/default.jpg)
![Ep 13: Another angle on monad transformers with Zio Prelude](https://i.ytimg.com/vi/tEnZZlOn-jI/default.jpg)
![Ep 9: Transformers, Monads in Disguise](https://i.ytimg.com/vi/KMm71HLoy0w/default.jpg)
![Ep 12: ReaderT is good for the environment](https://i.ytimg.com/vi/t7rfvpd9mD0/default.jpg)
![Ep 1: Scala 3 Enums, Implicits, and Context Functions](https://i.ytimg.com/vi/J01u_Dmrx5U/default.jpg)
![Ep 8: Compose Yourself with Scala 3's Opaque Types](https://i.ytimg.com/vi/v2TxejGEzg4/default.jpg)
![Ep 16: NonEmptyLists more or less](https://i.ytimg.com/vi/7A2xuRkCZBg/default.jpg)
![Ep 4: Scala 3 type classes](https://i.ytimg.com/vi/B2mTHpxw9JI/default.jpg)
![Ep 3: Evaluating our Numeric Type class](https://i.ytimg.com/vi/56Xj-5kCEm0/default.jpg)
![Ep 2: Type classes with Scala 2](https://i.ytimg.com/vi/pJFfXhZlR5o/default.jpg)
![Ep 14: Monad transformers using the Cats MTL library](https://i.ytimg.com/vi/aT6PNjqQLs8/default.jpg)
![Ep 5: Scala 3 Type lambdas, Functors and error handling](https://i.ytimg.com/vi/wNVQ75KM8-4/default.jpg)
![Ep 17: The Magic of LazyLists](https://i.ytimg.com/vi/laB15gG5bjY/default.jpg)
![Ep 6: Functional error handling with applicative in Scala 3](https://i.ytimg.com/vi/3GPXEzO14ZE/default.jpg)
![Ep 7: Monads with Scala 3 for the Genius](https://i.ytimg.com/vi/B1FSxbmZpCE/default.jpg)
![Ep 10: Tell me more! Add logging to a pure program with Applicative and WriterT in Scala 3](https://i.ytimg.com/vi/d4co05kJIhQ/default.jpg)