Scalaz Functor typeclass special symbols

前端 未结 1 1666
自闭症患者
自闭症患者 2021-01-15 09:54

Recently I have come across this Scalaz code (e.g. https://github.com/scalaz/scalaz/blob/series/7.2.x/core/src/main/scala/scalaz/Functor.scala):

def compose[         


        
相关标签:
1条回答
  • 2021-01-15 10:32

    This syntax is enabled by the kind-projector Scala plugin. It allows to write type lambdas in more concise way:

    Functor[λ[α => F[G[α]]]]
    

    Without the plugin it would look like:

    Functor[({type λ[x] = G[F[x]]})#λ]
    
    0 讨论(0)
提交回复
热议问题