tag:blogger.com,1999:blog-11295132.post8742838534827791706..comments2017-01-21T08:58:46.751-08:00Comments on A Neighborhood of Infinity: Programming with impossible functions, or how to get along without monads.Dan Piponihttps://plus.google.com/107913314994758123748noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-11295132.post-1220923411308603132009-12-23T10:43:20.111-08:002009-12-23T10:43:20.111-08:00Your coroutines can be extended with choice (a la ...Your coroutines can be extended with choice (a la session types) with a few more lines of code:<br /><br />readOpt f g (Left (c,cs)) = second Left $ f c cs<br />readOpt f g (Right (c,cs)) = second Right $ g c cs<br />writeRight o r is = let (v, os) = r (fromRight is) in (v, Right (o, os))<br />writeLeft o r is = let (v, os) = r (fromLeft is) in (v, Left (o, os))sclvnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-61314306293583769892009-12-22T10:19:36.398-08:002009-12-22T10:19:36.398-08:00Great stuff!
Interestingly, I just also found out...Great stuff!<br /><br />Interestingly, I just also found out about Bart Jacob's co-algebraic view on object-oriented programming. See for example his papers ...<br /><br /><a href="http://www.cs.ru.nl/B.Jacobs/PAPERS/OOcoA.ps" rel="nofollow">Objects and classes, co-algebraically </a><br /><br /><a href="http://www.cs.ru.nl/B.Jacobs/CLG/JacobsCoalgebraIntro.pdf" rel="nofollow">Introduction to Coalgebra. Towards Mathematics of States and Observations</a>heckenpenner_rothttp://www.blogger.com/profile/11645785715024119039noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-34115754485868266932009-12-09T22:18:40.326-08:002009-12-09T22:18:40.326-08:00Just came back as I encountered this talk:
http:/...Just came back as I encountered this talk:<br /><br />http://blog.well-typed.com/2009/12/talk-at-the-functional-programming-exchange/<br /><br />which also does something very reminiscent of the above.<br /><br />Must be something in the air these days.Janis Voigtländerhttp://www.iai.uni-bonn.de/~jv/noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-35973313018703557862009-12-03T19:26:02.715-08:002009-12-03T19:26:02.715-08:00Dear Author blog.sigfpe.com !
It is possible and ...Dear Author blog.sigfpe.com ! <br />It is possible and necessary :) to discuss infinitelyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-84832695630713413762009-11-29T23:51:11.762-08:002009-11-29T23:51:11.762-08:00Looking forward to it!Looking forward to it!Janis Voigtländerhttp://www.iai.uni-bonn.de/~jv/noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-87106515456943086542009-11-29T23:24:54.358-08:002009-11-29T23:24:54.358-08:00I've read that exceptions and continuations ar...I've read that exceptions and continuations are not algebraic effects. It would explain why Haskell need Monad and Lawvere Theories are not enough.<br /><br />But to be honest, I don't yet really understand it. The paper http://homepages.inf.ed.ac.uk/gdp/publications/Effect_Handlers.pdf is the cause of my confusion and I'll have to read it.<br /><br />In Plotkin papers, effects are related to constructors and handlers (not algebraic) to deconstructors.<br /><br />I wonder if there is a relation with coalgebra. I am just beginning to study effects so I have more questions than answers.alpheccarhttp://www.blogger.com/profile/14645433315403867431noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-54917471300892205222009-11-29T13:35:16.252-08:002009-11-29T13:35:16.252-08:00Janis,
Correction: Swiestra handles the free mona...Janis,<br /><br />Correction: Swiestra handles the free monad case. I intend to handle the non-free case.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-42457170859407502362009-11-29T08:38:20.474-08:002009-11-29T08:38:20.474-08:00Janis,
Thanks! Those papers look awesome. My next...Janis,<br /><br />Thanks! Those papers look awesome. My next blog post is going to be quite similar to Swiestra's "Monads for Free" section, except I plan to answer the bit where he says "It is not immediately obvious what the type of our algebra should be" slightly differently.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-476413609708463622009-11-29T03:23:42.863-08:002009-11-29T03:23:42.863-08:00Regarding the idea of modelling effects by first c...Regarding the idea of modelling effects by first constructing ASTs of an embedded language and then writing a small interpreter, you may want to consider this paper: <br />http://doi.acm.org/10.1145/1291201.1291206<br /><br />I think some of your code appears there almost literally.<br /><br />And (to plug my own work :-)) regarding the idea of afterwards eliminating the ASTs and interpreter overhead, you may want to look at this:<br /><br />http://dx.doi.org/10.1007/978-3-540-70594-9_20<br /><br />(It's a generic treatment, but Section 4 applies it to the "monad specification setting".)<br /><br />Finally, regarding how to nicely combine sublanguages for different effects, you may want to look at:<br /><br />http://dx.doi.org/10.1017/S0956796808006758<br /><br />Happy reading. :-)Janis Voigtländerhttp://www.iai.uni-bonn.de/~jv/noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-66112815362413828602009-11-28T22:33:52.568-08:002009-11-28T22:33:52.568-08:00Chreighton, yes, and "so called" can als...Chreighton, yes, and "so called" can also come across as "I'm an out of touch fuddy-duddy" - for example, when a judge writes something like "So-called computer "codes" direct the operation of the computer".Robinhttp://www.blogger.com/profile/05420921538604886480noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-56385982109018703252009-11-28T22:01:28.544-08:002009-11-28T22:01:28.544-08:00Colimits are the general categorical way of sticki...Colimits are the general categorical way of sticking things together.Derek Elkinshttp://www.blogger.com/profile/13447153951050085981noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-48020074188108621942009-11-28T19:17:20.200-08:002009-11-28T19:17:20.200-08:00Ooh, awesome. I actually hadn't read that pap...Ooh, awesome. I actually hadn't read that paper, but when Mr. Sigfpe said "quotient" my first thought was colimit. It looks like the coproduct isn't particularly useful in & of itself, but it's a nice proof of concept that colimits are the notion you want for combining monads. <br /><br />Not sure how to "pullback" colimits on free monads of signatures to more primitive operations.<br /><br />Also, this paper reminded me that one just shouldn't use the phrase "so called" in an academic work. Despite intentions, it sounds dismissive.Creighton Hogghttp://www.blogger.com/profile/09820771070038676909noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-3230983683610602392009-11-28T18:19:37.665-08:002009-11-28T18:19:37.665-08:00> an alternative universe in which languages li...> an alternative universe in which languages like Haskell develop along a path in which monads don't play a starring role. <br /><br />http://en.wikipedia.org/wiki/Standard_MLAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11295132.post-21789991999848112382009-11-28T17:21:38.165-08:002009-11-28T17:21:38.165-08:00This paper (which also has Ghani as a coauthor) ma...This paper (which also has Ghani as a coauthor) may be relevant, they give a construction of a monad coproduct which is a quotient:<br /><br />http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.8.3581Roly Pererahttp://www.blogger.com/profile/10168144731270158487noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-87617366250028505932009-11-28T14:02:46.856-08:002009-11-28T14:02:46.856-08:00Creighton,
That sounds a bit like where I got to....Creighton,<br /><br />That sounds a bit like where I got to. I can easily write code that takes pairs of sets of signatures, combines them, and makes you a monad. It works perfectly well with do-notation. But it's "too big" and you need an "interpreter" to cut it back down to size, ie. what you really want is a quotient.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-49165730446465661302009-11-28T13:50:58.893-08:002009-11-28T13:50:58.893-08:00There's a big caveat, imo, with that paper: y...There's a big caveat, imo, with that paper: you can combine the theories, but relating the monad made from them to the monad you morally _want_ is a little trickier.<br /><br />It wasn't clear to me how that gets resolved.Creighton Hogghttp://www.blogger.com/profile/09820771070038676909noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-50352178234982423282009-11-28T13:43:16.442-08:002009-11-28T13:43:16.442-08:00I'll check out that paper, at first glance it ...I'll check out that paper, at first glance it looks like exactly what I want. I searched hard for papers with concrete examples but everything I found was pretty abstract.sigfpehttp://www.blogger.com/profile/08096190433222340957noreply@blogger.comtag:blogger.com,1999:blog-11295132.post-39761559486737287492009-11-28T13:26:39.715-08:002009-11-28T13:26:39.715-08:00http://www.cs.nott.ac.uk/~gmh/modular.pdf
You prob...http://www.cs.nott.ac.uk/~gmh/modular.pdf<br />You probably would enjoy reading the above paper. It's a bit about how to implement the combination of signatures together.<br /><br />It's a bit...ungainly, but seems relevant.<br /><br />Now the thing that's really cute, and what ties in to Conal Elliott's Type Class Morphism paper, is that an actual implementation of a signature, a model, corresponds to a functor & morphisms between models correspond to natural transformations. Conal was looking at it more from the functorial point of view, you're starting a bit more directly from models.<br /><br />Either way, there's an equivalence between the perspectives (in the categoric sense).Creighton Hogghttp://www.blogger.com/profile/09820771070038676909noreply@blogger.com