Skip to content

Instantly share code, notes, and snippets.

View mjhopkins's full-sized avatar

Mark Hopkins mjhopkins

View GitHub Profile
import Pattern._
import Family._
def pattern[B](pf: PartialFunction[Name,B]) = new Extractor(pf.lift)
val Parents = new Extractor(parents.get)
val Children = new Extractor(children.get)
"Julie" match {
case Parents(p) => "Julies parents are: " + p
@dysinger
dysinger / gist:8760823
Created February 1, 2014 23:40
Idris -> Java Hello World in 6 lines
$ cabal sandbox init
$ cabal install idris
$ echo 'main : IO () ; main = print "hello"' >hello.idr
$ ./.cabal-sandbox/bin/idris --mvn --codegen Java -o hello hello.idr
$ cd hello
$ mvn -DmainClass=hello package shade:shade
$ java -jar target/hello.jar
"hello"