Skip to content

Instantly share code, notes, and snippets.

View egp's full-sized avatar

Edward G Prentice egp

View GitHub Profile
@etorreborre
etorreborre / short_implicitly.scala
Created November 26, 2014 22:55
Short implicitly form
// for a given typeclass
trait CharIso[T] {
def toChar(t: T): Char
def fromChar(c: Char): T
}
// provide the following apply method
// so that you can write: CharIso[T].toChar(...) instead of implicitly[CharIso[T]].toChar(...)
object CharIso {
def apply[T : CharIso]: CharIso[T] = implicitly[CharIso[T]]