I am learning Scala and see the follow code in a tutorial
case class Email (
subject: String,
text: String,
sender: String,
recipient: String)
type EmailFilter = Email => Boolean
def newMailsForUser(mails: Seq[Email], f: EmailFilter) = mails.filter(f)
val notSentByAnyOf: Set[String] => EmailFilter =
senders => email => !senders.contains(email.sender)
I understand that notSentByAnyOf is a function type that has the signature type Set[String] => EmailFilter.
However, I am not sure what senders => email => !senders.contains(email.sender) means.
Can I please get some explanation?
Thank you very much for your help!