Lessons from Haskell

Posted on November 11, 2021
Tags: misc

1 Designing Data types

Design a tic tac toe board

  1. Naive data structure, 9 spots = 9 constructor product type = struct or record type
  2. Observe that \(3^2=9\) and a algebraic exponential type is a function type 2 -> 3 aka (X-axis, Y-axis) -> (1st,2nd,3rd)