
* Stephen Tetley
On 16 April 2013 16:12, Alejandro Serrano Mena
wrote: Hi, First of all, let me say that this work on matchers is really useful :)
Following Roman advice, I'm trying to find a more principled approach that could be useful for this library. It seems that "Match" could easily be converted to Either and thus made into Functor, Applicative, Alternative and Monad. That would allow to write things like:
Have you seen Ralf Hinze, Johan Jeuring and Andreas Loeh's paper on Contracts?
The found their Contract datatype formed a comonad - at the time this seemed to be one of the few (non-synthetic) uses of comonads.
Their Contract datatype is contravariant, just like Tom's Matcher. So it cannot be a comonad. It's their "contracted function" type which is a (very simple) comonad — but I'm not sure how it can be useful here. (I only skipped very quickly through the paper, so I may be missing something.) Roman