@@ -27,7 +27,7 @@ object GenericHelper {
2727 // Polymorphic function which adds 1 to any Int and is the identity
2828 // on all other values
2929 // format: OFF
30- object inc extends -> ((i : Int ) ⇒ i + 1 )
30+ object inc extends -> ((i : Int ) => i + 1 )
3131 // format: ON
3232 case class Book (author : String , title : String , id : Int , price : Double )
3333 case class ExtendedBook (author : String , title : String , id : Int , price : Double , inPrint : Boolean )
@@ -124,21 +124,19 @@ object GenericExercises
124124 val tapl = Book (" Benjamin Pierce" , " Types and Programming Languages" , 262162091 , 44.11 )
125125 val rec = bookGen.to(tapl)
126126
127- rec(' price ) should be(res0)
127+ rec(Symbol ( " price" ) ) should be(res0)
128128
129- val updatedBook = bookGen.from(rec.updateWith(' price )(_ + 2.0 ))
129+ val updatedBook = bookGen.from(rec.updateWith(Symbol ( " price" ) )(_ + 2.0 ))
130130
131131 updatedBook.price should be(res1)
132132
133- /** {{{
134- * case class ExtendedBook(author: String, title: String, id: Int, price: Double, inPrint: Boolean)
135- * }}}
136- */
133+ // case class ExtendedBook(author: String, title: String, id: Int, price: Double, inPrint: Boolean)
134+
137135 import syntax .singleton ._
138136
139137 val bookExtGen = LabelledGeneric [ExtendedBook ]
140138
141- val extendedBook = bookExtGen.from(rec + (' inPrint ->> true ))
139+ val extendedBook = bookExtGen.from(rec + (Symbol ( " inPrint" ) ->> true ))
142140
143141 extendedBook.inPrint should be(res2)
144142 }
0 commit comments