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 console extends App { | |
trait Printer[T] { | |
def print(t: T): String | |
} | |
object Printer { | |
implicit val intPrinter: Printer[Int] = new Printer[Int] { | |
def print(i: Int) = s"$i: Int" |
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 console extends App { | |
trait Op | |
trait Open extends Op | |
trait Close extends Op | |
trait Door[O <: Op] | |
object Door { | |
def apply[S <: Op] = new Door[S] {} |
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 Foo { | |
trait Bar | |
} | |
object FooImpl extends Foo { | |
object ABar extends Bar | |
object BBar extends Bar | |
} | |
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 scalaz.concurrent.Task | |
import scalaz.concurrent.Strategy._ | |
object console extends App { | |
object Process { | |
def liftOne[I,O](f: I => O): Process[I,O] = Await { | |
case Some(i) => Emit(f(i)) | |
case None => Halt() | |
} |
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 scalaz._, Scalaz._ | |
import scalaz.concurrent.Task | |
object console extends App { | |
trait Op[T] | |
case class Read[T](t: T) extends Op[T] | |
case class Write[T](t: T) extends Op[T] | |
type OpC[T] = Coyoneda[Op, T] |
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._ | |
object console extends App { | |
trait Reverse[T <: HList] { | |
type Out <: HList | |
def reverse(t: T): Out | |
} | |
object Reverse { |
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 foo extends App { | |
trait HList | |
trait HNil extends HList | |
case object HNil extends HNil { | |
def ::[H](h: H): H :: HNil = foo.::(h, HNil) | |
} | |
case class ::[H, T <: HList](h: H, t: T) extends HList { self => | |
def ::[H](h: H) = foo.::(h, self) |
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._, record._, ops.record._ , syntax.singleton._, labelled._ | |
object console extends App { | |
trait Print[T <: HList] { | |
def print(t: T): String | |
} | |
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._, record._, ops.record._ , syntax.singleton._, labelled._ | |
object console extends App { | |
case class Foo(i: Int,s: String) | |
trait Check[L] extends SingletonProductArgs { | |
def applyProduct[T <: HList, LR <: HList] | |
(t: T) | |
(implicit |
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 scalaz._ | |
import Scalaz._ | |
object console extends App { | |
trait Foo[A] { | |
type B | |
def value: B |