mirror of
https://github.com/typelevel/simulacrum.git
synced 2024-11-29 01:24:09 +03:00
fix typo
This commit is contained in:
parent
c54ff75965
commit
02174dbe56
@ -203,7 +203,7 @@ class TypeClassMacros(val c: Context) {
|
||||
val skipMethod = !simpleArgs.foldLeft(true)(_ && _._2.isDefined)
|
||||
|
||||
if(skipMethod) List.empty else {
|
||||
//rewrites all occurences of any of the args which are defined on the method to the lifted arg
|
||||
//rewrites all occurrences of any of the args which are defined on the method to the lifted arg
|
||||
val rewriteSimpleArgs = new FoldTransformer(simpleArgs.foldLeft(List.empty[Transformer]) {
|
||||
case (ts, (_, Some(simpleArg), liftedTypeArg, _)) => new RewriteTypeName(from = simpleArg.toTypeName, to = liftedTypeArg.name) :: ts
|
||||
})
|
||||
|
@ -10,12 +10,12 @@ import scala.collection.immutable.List
|
||||
class JvmTypeClassTest extends WordSpec with Matchers {
|
||||
"the @typeclass annotation" should {
|
||||
"generate serializable traits by default" in {
|
||||
seralizeDeserialize(Semigroup[Int]).append(1, 2) shouldBe 3
|
||||
seralizeDeserialize(Functor[List]).map(List(1, 2, 3))(_+1) shouldBe List(2, 3, 4)
|
||||
serializeDeserialize(Semigroup[Int]).append(1, 2) shouldBe 3
|
||||
serializeDeserialize(Functor[List]).map(List(1, 2, 3))(_+1) shouldBe List(2, 3, 4)
|
||||
}
|
||||
}
|
||||
|
||||
def seralizeDeserialize[A](value: A): A = {
|
||||
def serializeDeserialize[A](value: A): A = {
|
||||
import java.io.{ ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream }
|
||||
val bytesOut = new ByteArrayOutputStream()
|
||||
val os = new ObjectOutputStream(bytesOut)
|
||||
|
@ -206,7 +206,7 @@ class Examples extends WordSpec with Matchers {
|
||||
(1 |+| 2) =#= (2 |+| 1)
|
||||
}
|
||||
|
||||
// Alernatively, multiple type class ops can be combined in to a syntax object, which provides
|
||||
// Alternatively, multiple type class ops can be combined in to a syntax object, which provides
|
||||
// a single import for all implicit conversions
|
||||
{
|
||||
object all extends Equal.ToEqualOps with Semigroup.ToSemigroupOps with Monoid.ToMonoidOps
|
||||
|
Loading…
Reference in New Issue
Block a user