About Comonads for UIs

I’ve come upon this paper some time ago and it was sitting in the back of my mind and I want to explore the concept. It seems that there are no real-world uses of this concept. Any reason why that may be the case? Is this impractical for some reason or it just happened that noone picked this up?

4 Likes

Edit: to explain what I’m talking about about, I found the same paper and did my own spelunking. But if comonads are close to a functional encoding of objects, one, does the relationship between comonads and lenses render them irrelevant? Two, does comonadic GUI simply turn into a rehash of OOP GUI, an approach that OOP is good at? On the other hand, functional rehashes of imperative concepts ARE an interesting research angle; the IO type gave birth to the do interface, and between do and class Applicative m => Monad m we have a lot of fun research and exploration of what we can do with monadic types and effect systems.


I haven’t fully done the research, but an interesting angle is the relationship between comonads and lenses. There’s also a disputed article by Gabriella Gonzalez calling comonads objects:

Read this retort as well.

Well, according to the paper the Elm Architecture is a specialization of the concept, so you could argue it has real-world uses (and it is liked by people that use it).

For starters I never heard of it or thought about it.

The author also hints that

The complexity of the concepts involved in this model, however, may impose a great
difficulty on its adoption for the development of real-world applications. One limitation of the technique, in the way it is presented in this thesis, is that it is considerably difficult to generate or discover monads that may be used to describe movements in a space defined a comonad; that is, it is difficult to find pairings between comonads and monads.

and

By using a technique proposed by Kmett [2011] (and used by Freeman [2016b] in the original model), we shall be able to to eliminate the necessity of finding or developing specific monads and pairings for given comonads, something that has been shown an extremely laborious task.

So basically you need to be Edward Kmett to do UI, haha.