Загрузка страницы

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
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
3 декабря 2021 г. 22:57:14
00:29:20
Яндекс.Метрика