Skip to content

Instantly share code, notes, and snippets.

View therealcisse's full-sized avatar

Amadou Cisse therealcisse

View GitHub Profile
// comparing to kotlin version: https://proandroiddev.com/extension-classes-f9dcf5878b71
sealed trait Feature
object SomeFeature extends Feature
trait AppFeatures {
def isEnabled(feature: Feature): Boolean
}
extension (appFeatures: AppFeatures) {
@therealcisse
therealcisse / ImmutableLRU.scala
Created October 7, 2021 12:19 — forked from Daenyth/ImmutableLRU.scala
LruRef / LRU for cats-effect
package teikametrics
import scala.collection.SortedMap
/**
* Immutable implementation of an LRU cache.
*
* @author Twitter
*
* Copy pasted from the version previously in twitter-util v19.1.0 at