Skip to content

Instantly share code, notes, and snippets.

@wchristian
Created December 28, 2013 00:21
Show Gist options
  • Save wchristian/8154428 to your computer and use it in GitHub Desktop.
Save wchristian/8154428 to your computer and use it in GitHub Desktop.
A cat-readable Haskell summary

Haskell tries to be a pure functional language, for which these rules apply:

  1. All functions only does this: Take input, produce output from it; whenever input is the same, output needs to be the same, nothing else may happen. No exceptions.
  2. All functions take only a single argument. No exceptions.

This forbids things like printing to the screen, passing 1 and 1 to the plus function and other useful things. But since Haskell only tries to be pure it allows itself to be a little bit impure and has constructs that are excempt from these rules, so Haskell can be useful. Monads are these constructs.

Monads are the house rules you bring to your Monopoly game to make it fun.

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