Skip to content

Instantly share code, notes, and snippets.

import ops1._
import ops2._
object ops1 {
implicit class TestOps(val str: String) {
def op1: String = str
}
}
object ops2 {
package foo
trait Decoder[E, D] {
def decode(e: E): D
}
// Represents a named collection of documents of type A
trait Documents[A] {
def name: String
def take(target: Int): Documents[A]
// [...]
}
// Represents a collection of named collections of documents.
// A is the type of a document, D that of a named collection of documents
@nrinaudo
nrinaudo / gist:d13bea758bc7c2d7d078
Created November 7, 2015 17:40
export-hook NPE stack trace
> last core/compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set(/Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/target/scala-2.11/classes/tabulate/RowDecoder$$anonfun$tuple3$1.class, /Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/target/scala-2.11/classes/tabulate/RowDecoder$$anonfun$caseDecoder20$1$$anonfun$apply$198$$anonf$$$$84a54a79d7c6b00e342f21de72f88d9$$$$$211$$anonfun$apply$212$$anonfun$apply$213$$anonfun$apply$214$$anonfun$apply$215.class, /Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/target/scala-2.11/classes/tabulate/CellDecoder$$anonfun$10$$anonfun$apply$9.class, /Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/target/scala-2.11/classes/tabulate/RowDecoder$$anonfun$caseDecoder8$1$$anonfun$apply$36$$anonfun$apply$37.class, /Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/target/scala-2.11/classes/tabulate/CellEncoder$$anonfun$opt$1.class, /Users/nicolasrinaudo/dev/nrinaudo/tabulate/core/t
@nrinaudo
nrinaudo / Encoder.scala
Created November 3, 2015 19:20
Demonstration of my issues with export-hook
import export._
trait Encoder[T] {
// Type class defns ...
}
object Encoder extends EncoderLowPriority {
// Instances which should be higher priority than derived
// or subclass instances should be defined here ...
}
@nrinaudo
nrinaudo / GZip.scala
Created February 26, 2014 14:07
Sample implementation of automated un-gzipping of client entity bodies.
import unfiltered.request._
import unfiltered.response.BadRequest
import unfiltered.Cycle
import java.nio.charset.Charset
import scala.util.Try
object ContentEncoding extends ConnegHeader("Content-Encoding")
object Encodes {
trait Encoding {