The following trait Parser[+T] is a trait that extends a function that accepts an Input and returns a Result[T].
trait Parser[+T] extends (Input => Result[T])
Is that correct?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Right.
Input => Result[T]is a shortcut forFunction1[Input, Result[T]].It has an abstrat method
which when defined will be the actual function implementation.
Scala syntax allows methods called
applyto be called silently, that is for some expressione,e(x1, ... xn)will be translated toe.apply(x1, ... xn)