Commit 757fd0d8 authored by Haochen Xie's avatar Haochen Xie

comment some unfinished code in src/main/scala/name/haochenxie/fpscala/ch10/Monoids.scala

parent fa7d5469
......@@ -76,13 +76,13 @@ trait Parsers[ParserError, Parser[+_]] { self =>
}
class ParserCombinatorsScratch(P: Parsers) {
import P._
val digitP = regex("[0-9]".r)
val intP = P.map(digitP.many)(l => l.reduce(_+_)).map(_.toInt)
// Exercise 9.6
val ex9_6 = P.flatMap(intP)(n => P.listOfN(n, char('a')))
}
//class ParserCombinatorsScratch(P: Parsers) {
// import P._
//
// val digitP = regex("[0-9]".r)
// val intP = P.map(digitP.many)(l => l.reduce(_+_)).map(_.toInt)
//
// // Exercise 9.6
// val ex9_6 = P.flatMap(intP)(n => P.listOfN(n, char('a')))
//
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment