Skip to content

Instantly share code, notes, and snippets.


Erik Osheim non

  • Providence / Philly
View GitHub Profile
non / JavapPlugin.scala
Created Jan 29, 2018
Slouching toward a functioning SBT plugin.
View JavapPlugin.scala
package sbtjavap
import sbt._
import Keys._
import complete.DefaultParsers.StringBasic
import scala.sys.process.Process
object Plugin extends AutoPlugin {
object autoImport {
non /
Last active Jan 2, 2018
Some notes about the interaction of SIP-23 with specialization.


I was asked to consider how specialization should interact with SIP-23. Here is a quick test I did with some thoughts on where we are now versus where we should be.

See tlc.scala for the code and tlc.bytecode for the Java bytecode that code produced (using Typelevel Scala with the -Yliteral-types flag enabled).


SIP-ZZ - NewType Classes


This is a proposal to introduce syntax for classes in Scala that can get completely inlined, so operations on these classes have zero overhead compared to external methods. Some use cases for inlined classes are:

  • Inlined implicit wrappers. Methods on those wrappers would be
non / builtins.txt
Last active May 12, 2017
List of classes/traits in Scala's standard library that are probably worth supporting via type classes. The implication being that other types (e.g. GenSeq) are not worth supporting directly. Suggested additions welcome!
View builtins.txt
View NotFantastic.scala
// this code demonstrates unsoundness in scala (tested in 2.11 and 2.12)
// it seems like scala is checking that the return type is a Pipe[_]
// but not a Pipe[E]; maybe due to erasure?
sealed abstract class Pipe[E]
case class Single[E](elem: E) extends Pipe[E]
case class Double[A, B](a: Pipe[A], b: Pipe[B]) extends Pipe[(A, B)]
object Pipe {
non /
Last active Feb 2, 2019
I feel like conversations around laws and lawfulness in Scala are often not productive, due to a lack of rigor involved. I wanted to try to be as clear and specific as possible about my views of lawful (and unlawful) behavior, and what I consider a correct and rigorous way to think about laws (and their limits) in Scala.


A law is a group of two or more expressions which are required to be the same. The expressions will usually involve one or more typed holes ("inputs") which vary.

Some examples:                 === x
non / mark.scala
Created Jan 3, 2017
Scala solver for Mark Dominus' arithmetic puzzle (
View mark.scala
package mark
import spire.math.{ Rational => Q }
object Solver2 {
case class Op(name: String, run: (Q, Q) => Option[Q])
val ops: List[Op] = List(
Op("+", (x, y) => Some(x + y)),
View gist:ee5eb4ae64125b60ddc794742e0fc7e5
### higher profile independent games
868-hack: really fun glitchy hacking game
diaries of a spaceport janitor: meditative weirdness, cryptic walking sim
ftl: roguelike space adventure game #1
out there: rogulike space exploration game #2
hadean lands: alechmical exploration text adventure
sunless sea: steampunk underground sailing game
this war of mine: too real refugee-during-wartime sim
vvvvvv: light-hearted/abstract platform puzzle game
View twine-games.txt
16 Ways To Kill A Vampire At McDonalds
by @AbigailMoment (Abigail Corfman)
humorous game about a vampire killer's night off
My Father's Long, Long Legs
@WarrenIsDead (Michael Lutz)
non / beala.scala
Created May 9, 2016
Demo using Cats/Dogs to implement lazy memoization, similar to this Haskell gist:
View beala.scala
package beala
import dogs._
object Beala {
// ironically dogs doesn't support unsafe operations by default,
// so we have to build them ourselves (since we know our stream
// is infinite and will always have elements).
def head[A](as: Streaming[A]): A =