0

I've been checking Atlassian Typeclassopedia for Scala (examples using Scalaz) and I don't understand the function monad definition (I've never seen such syntax for type parameters):

implicit def FunctionMonad[R] = new Monad[({type l[a] = R=>a})#l] {
  def >>=[A, B](fa: R => A)(f: A => R => B) : R => B = (x => f(fa(x))(x))
  ...
}

Could someone please elaborate on what {type l[a] = R=>a})#l actually does?

jarandaf
  • 4,297
  • 6
  • 38
  • 67
  • see http://stackoverflow.com/questions/8736164/what-are-type-lambdas-in-scala-and-what-are-their-benefits hth – Gavin Feb 02 '15 at 15:22
  • Thanks @Gavin, never heard of type lambdas. I am afraid this is a duplicated question then... – jarandaf Feb 02 '15 at 15:29

0 Answers0