((((((((((((((())))))))))))))))))))))))
This file contains hidden or 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
sealed trait Fruits | |
object Fruits { | |
case class Banana() extends Fruits | |
case class Apple() extends Fruits | |
} | |
// This could be just FruitsBehaviou[-A] | |
trait FruitsBehavior[-A <: Fruits] { | |
def price(a: A): Int |
This file contains hidden or 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
package tech | |
trait Mondoid[T] { | |
def zero: T | |
def append(a: T, b: T): T | |
} | |
object Mondoid { | |
def apply[A](implicit instance: Mondoid[A]): Mondoid[A] = instance | |
} |
NewerOlder