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
trait CanTruthy[A] { | |
def truthys(a: A): Boolean | |
} | |
object CanTruthy { | |
def apply[A](implicit ev: CanTruthy[A]): CanTruthy[A] = ev | |
def truthys[A](f: A => Boolean): CanTruthy[A] = new CanTruthy[A] { | |
def truthys(a: A): Boolean = f(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
import shapeless._ | |
import poly._ | |
import shapeless.ops.tuple.FlatMapper | |
import syntax.std.tuple._ | |
object Flatten { | |
trait LowPriorityFlatten extends Poly1 { | |
implicit def default[T] = at[T](Tuple1(_)) | |
} | |
object flatten extends LowPriorityFlatten { |
NewerOlder