Skip to content

Instantly share code, notes, and snippets.

View cmk's full-sized avatar

Chris McKinlay cmk

View GitHub Profile
@cmk
cmk / Constraints.org
Created January 18, 2019 02:51 — forked from Icelandjack/Constraints.org
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

@cmk
cmk / free_monad_interpreter_pattern.md
Created January 2, 2017 22:30 — forked from CMCDragonkai/free_monad_interpreter_pattern.md
Haskell: Free Monad + Interpreter Pattern

Free Monad + Interpreter Pattern

It's like creating the front end and back end of a compiler inside Haskell without the need of Template Haskell!

Write your DSL AST as a Free Monad, and then interpret the monad any way you like.

The advantage is that you get to swap out your interpreter, and your main code