Reading group: Learn You a Haskell: Part Three

Next week, on Friday, February 28, we’ll cover the next two chapters:

  • Modules
  • Making Our Own Types and Typeclasses

I checked, and they’re roughly the same, whether you read the HTML or ebook version.

We didn’t get all the way through “Making Our Own Types and Typeclasses” this week, as that chapter was really dense. We covered:

  • Loading modules in ghci
  • Importing modules
  • Qualified import
  • Data.List
  • Data.Char
  • Data.Map
  • foldl’
  • Hoogle
  • Making modules
  • data (new types)
  • Value constructor functions
  • Exporting types
  • Record syntax
  • Type parameters
  • Type constructors
  • Derived instances
  • Show, Eq, Read, Ord
  • type (type aliases)
  • type class instances
  • Subclassing

We have an outstanding question: can you make your own typeclasses derivable? @pat and I are going to experiment and report back.

Next week, we’ll cover:

  • Functors, fmap, Maybe, and Either
  • Input/Output

Bad news on the deriving instances: you can’t make your own.

This is the best answer I’ve found: typeclass - How does deriving work in Haskell? - Stack Overflow

There’s some stuff in the works for this, but it’s experimental: generic deriving · Wiki · Glasgow Haskell Compiler / GHC · GitLab