Follow

@reidrac@social.sdf.org writing parsers is a good way to understand the language. It trains a few things about composition, assembling code from smaller parts.

Type classes are Haskell's power tools of the trade (:
They encode many common patterns about types and make that distinct coding flow of "delegate this away and let me focus on my types here" (that you did with the Vector instance).

You can use the Typeclassopedia for an overview of what you can encounter in the wild and where they can be helpful. You don't have to remember everything, just the names of the things and maybe the context where you may encounter them.

The most important are Semigroup/Monoid, Functor/Applicative/Monad, and Functor/Foldable/Traversable. Recently dual-variable classes like Bifunctor are starting to get prominence too.

wiki.haskell.org/Typeclassoped

@reidrac@social.sdf.org Just found something that can be a good kata on parsers and typeclasses.

And not without utility! You can add some CLI options to your game while getting acquainted with the basics.

lhbg-book.link/05-glue/04-optp

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.