Skip to content

Instantly share code, notes, and snippets.

@ruurtjan
Created May 1, 2020 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruurtjan/c0a0d3a725d1eabce1fcb145d3d4bf83 to your computer and use it in GitHub Desktop.
Save ruurtjan/c0a0d3a725d1eabce1fcb145d3d4bf83 to your computer and use it in GitHub Desktop.
functional-dsl-blog-4.scala
sealed trait EmailFilter { self =>
def &&(that: EmailFilter): EmailFilter = EmailFilter.And(self, that)
def ||(that: EmailFilter): EmailFilter = (self.negate && that.negate).negate
def negate : EmailFilter = EmailFilter.Not(self)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment