1

Topic: [Scala] Explain a construction "self =>"

I study library Scalaz, permanently I see there type constructions: trait Monad [F [_]] extends Applicative [F] with Bind [F] {self =>////} I can not understand In any way that such "self =>". Read the documentation, there write that self: SomeType => sets the requirement to a class which will "inherit" this trait, and sets type for this so that it is possible through this to cause methods of an "inheriting" class. It like clear. But what such self =>, without type? I look in source codes - not always even I see usage this or self in these trait... What for it?

2

Re: [Scala] Explain a construction "self =>"

Hello, eaglus, you wrote: E> But what such self =>, without type? E> I look in source codes - not always even I see usage this or self in these trait... E> What for it? Most likely it is simple for uniformity what not to think afterwards self has been declared or not, and easier to use it. In this case it does not carry any functional loading.

3

Re: [Scala] Explain a construction "self =>"

Hello, eaglus, you wrote: E> But what such self =>, without type? Without type it does not demand to have in parents someone especial. Simply  for this.