Example #1
0
 /**
  * Returns a parser that produces the given string or fails otherwise.
  *
  * @param missing The error if the producing stream could not supply more characters.
  * @param sat The error if a character was produced that is not the given string.
  * @param s The string to produce.
  * @return A parser that produces the given string or fails otherwise.
  */
 public static <E> Parser<Stream<Character>, String, E> string(
     final F0<E> missing, final F<Character, E> sat, final String s) {
   return characters(missing, sat, List.fromString(s).toStream())
       .map(cs -> List.asString(cs.toList()));
 }