Skip to content

Instantly share code, notes, and snippets.

@monaddle
monaddle / .block
Created June 15, 2019 20:21
fresh block
license: mit
@monaddle
monaddle / .block
Last active June 15, 2019 20:34
simple timeline
license: mit
@monaddle
monaddle / composableinterpreters.scala
Created September 9, 2017 03:00
free monads using scalaz. Example of composing interpreters.
package testfree
import testfree.Console._
import testfree.Authorization.{ Authorize}
import scalaz.{Inject, _}
import Scalaz._
import scala.io.StdIn
import scalaz.Inject._
// Example of using two separate ADTs with separate interpreters and composing the interpeters.
// See talk by Runar Bjarnason https://www.youtube.com/watch?v=M258zVn4m2M, or "onion architecture" description
@monaddle
monaddle / recursion schemes.scala
Last active February 13, 2019 19:32
Recursion schemes implemented in Scala using Matroyshka. They don't all make sense or anything, but they compile and run. lo
package prestwood
// Examples of recursion scheme implementations using matroysha. Mostly they're not that useful,
// and I really only got three tricks down, but they're good tricks:
// 1. Collect information across an AST using a Writer monad
// 2. Modify AST nodes in place
// 3. Annotate AST nodes with arbitrary types