All the derived specializations of bracket aren't actually lazy in their argument when the generated parser is finally applied to some string. This prevents me from writing mutually recursive parsers that make use of any of these specializations of bracket as they will promptly enter an infinite loop when asked to parse any string.
import atto._
import Atto._
def dummyParser: Parser[Char] = {println("activate!"); char('a')}
// Prints activate!
parens(dummyParser).parseOnly("notparentheses")
def myParens[A](p: => Parser[A]): Parser[A] =
bracket(char('('), p, char(')')) // Notice the absence of named
// Does not print anything
myParens(dummyParser).parseOnly("notparentheses")