2-Dimensional Algebraic Data Type

This page summarizes the projects mentioned and recommended in the original post on /r/haskell

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • conway

    Demonstrating comonad transformers. (by gelisam)

  • Now, while it's a bad idea to have a node-and-edges data structure with edges in both directions, it is, of course, nevertheless very useful to be able to navigate in both directions. The Comonad abstraction is very useful for modelling the topology of a data structure, that is, to model which cells are above, below, to the left, and to the right of each other. This abstraction isn't really a new way to represent the data (we can use any of the representations we've discussed above), it's a layer of information we can put on top of the data in order to navigate. My conway repo implements (...but does not really explain) such a 2D array in the context of Conway's Game of Life. I chose to have the array wrap around both horizontally and vertically, but you could also make the world stop at the boundary by giving a different Comonad instance. That's kind of the point: you write a Comonad instance to explain the topology of your structure, including whether it wraps around or not.

  • acme-circular-containers

    Spineless containers which are fast to read but inefficient to update

  • You could also have edges pointing up and left in addition to down and right... but then updating any cell would cost O(width*height), because we'd once again have to allocate an entire new array. See my acme-circular-containers package for more information about that kind of approach and why it is a bad idea.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts