The one place I've used "this" outside the context of a class is when I built a monad as an object and decided to use set the "this" context to be the monad. So, for example "return/unit/pure" (or whatever you want to call it :-) ) is available as "this.return". In that way the functions passed to "bind" can be generic and still build the correct monad.
There are other ways to do it, but this struck me as the first time I had fiddled with "this" and felt that it was a reasonable idea.
There are other ways to do it, but this struck me as the first time I had fiddled with "this" and felt that it was a reasonable idea.