Skip to content

avoid view bounds #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ trait Parsers {
* @param es the list of expected elements
* @return a Parser that recognizes a specified list of elements
*/
def accept[ES <% List[Elem]](es: ES): Parser[List[Elem]] = acceptSeq(es)
def accept[ES](es: ES)(implicit f: ES => List[Elem]): Parser[List[Elem]] = acceptSeq(es)

/** The parser that matches an element in the domain of the partial function `f`.
*
Expand Down Expand Up @@ -661,7 +661,7 @@ trait Parsers {
* @param es the list of expected elements
* @return a Parser that recognizes a specified list of elements
*/
def acceptSeq[ES <% Iterable[Elem]](es: ES): Parser[List[Elem]] =
def acceptSeq[ES](es: ES)(implicit f: ES => Iterable[Elem]): Parser[List[Elem]] =
es.foldRight[Parser[List[Elem]]](success(Nil)){(x, pxs) => accept(x) ~ pxs ^^ mkList}

/** A parser that always fails.
Expand Down