Skip to content

Instantly share code, notes, and snippets.

@edwardGunawan
Created April 18, 2022 18:02
5 Anti Pattern for Writing Code in a Functional Programming Language
implicit class ListOp[A](lst: List[A]) {
def filterBy(p: A => Predicate): List[A] = lst.filter{ p(_) match {
case Predicate.Keep => true
case Predicate.Discard => false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment