10 ms·
There's a neat connection between comonads and OOP. Comonads are used to describe context-dependent computations. In OOP, you might define a class along with s
by profquail 14y ago
There's a neat connection between comonads and OOP.
Comonads are used to describe context-dependent computations. In OOP, you might define a class along with some instance methods (which access private fields or somesuch in order to manipulate the state of the program).
The connection between comonads and OOP arises when you think of a comonad where the "context" is an instance of your class -- so your class methods are the context-dependent computations.