Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mkString[E](start: String, sep: String, end: String): Iteratee[E, String] = {
- def step(s: String, isFirst: Boolean)(input: Input[E]): Iteratee[E, String] = {
- input match {
- case Input.EOF => Done(s + end, Input.EOF)
- case Input.Empty => Cont(step(s, isFirst))
- case Input.El(e) => { val s1 = if(isFirst) { s + e.toString } else { s + sep + e.toString }; Cont[E, String](i => step(s1, false)(i)) }
- }
- }
- Cont(step(start, true))
- }
Add Comment
Please, Sign In to add comment