How to sequence Either with Scala cats without a type alias (see Herding cats)

前端 未结 1 452
清歌不尽
清歌不尽 2020-12-19 21:58

I was reading Herding Cats

The final example on the Traverse page on sequencing List of Either failed for me.

in the example they do this:-

         


        
相关标签:
1条回答
  • 2020-12-19 22:21

    Your code lacks scalac option -Ypartial-unification.

    In build.sbt you should add

    scalaVersion := "2.12.6"
    
    libraryDependencies += "org.typelevel" %% "cats-core" % "1.1.0"
    
    scalacOptions += "-Ypartial-unification"
    

    or start Scala console with command

    scala -Ypartial-unification
    

    http://eed3si9n.com/herding-cats/partial-unification.html

    0 讨论(0)
提交回复
热议问题