Skip to content

Instantly share code, notes, and snippets.

@jdanbrown
jdanbrown / gist:4747205
Last active January 30, 2019 10:44
Object algebras example in scala
#!/bin/bash
exec ~/src/scala/bin/scala -savecompiled "$0" "$@"
!#
// Example of object algebras, based on the scala example at http://ropas.snu.ac.kr/~bruno/oa/
// type Term = ∀A,O. O[A] -> A
trait Term[O[_]] {
def apply[A](o: O[A]): A
}