Skip to content

Instantly share code, notes, and snippets.

@aconbere
Last active December 15, 2015 02:39
Show Gist options
  • Save aconbere/5188516 to your computer and use it in GitHub Desktop.
Save aconbere/5188516 to your computer and use it in GitHub Desktop.
M-O-N-A-D-S

As software developers we use datastructures all the time Linked Lists, Hash Maps, Stacks. Most datastructures have a set of related operations that we can think of as the core pieces that define that structure in Scala we call the collection of those operations a Trait on in Java an Interface. A Hash Map exposes the Map interface and has an operations to add a key and value +, remove a key -, retrieve the value at key get and an operation like fold to operate over the List of keys and values.

We have certain expectations of these datastructures from our experiences, we expect Maps to be hash maps, and we expect queues to be stacks. But there's no law that requires that. A common replacement of as Hash Map is a Tuple List,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment