Created
April 18, 2022 18:02
5 Anti Pattern for Writing Code in a Functional Programming Language
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
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