This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; scala-mode2 found here: https://github.com/hvesalai/scala-mode2 is much better than the scala mode that comes with scalac | |
(add-to-list 'load-path "~/.emacs.d/scala-mode2/") | |
(require 'scala-mode) | |
; http://www.emacswiki.org/emacs/RainbowDelimiters | |
(add-hook 'scala-mode-hook 'rainbow-delimiters-mode) | |
; I get ensime from git: | |
; https://github.com/aemoncannon/ensime | |
; then run `sbt stage` inside the ensime source directory, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object GOption { | |
def some[A](a: A): GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
def none[A]: GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
} | |
trait GOption[+A] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the given block +num+ times and then print out the mean, median, min, | |
# max, and stddev of the run. For example: | |
# | |
# irb> stats(10) { sleep(rand / 100) } | |
# mean: 5.99ms | |
# median: 6.76ms | |
# min: 1.49ms | |
# max: 9.28ms | |
# stddev: 2.54ms |