tag:blogger.com,1999:blog-1777990983847811806.post4739765642991578518..comments2021-01-13T10:05:51.701-08:00Comments on Haskell for all: How the continuation monad worksGabriel Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-1777990983847811806.post-82489063082587260632020-12-23T01:15:28.102-08:002020-12-23T01:15:28.102-08:00I got interested in continuations playing around w...I got interested in continuations playing around with some more basic functions. What an interesting pattern. The intuition kind of "clicked" when experimenting with it.<br /><br />intCont :: (Int -> r) -> r<br />intCont f = f 2<br /><br />strCont :: (String -> r) -> r<br />strCont f = f "hello"<br /><br />p2Cont :: (Int -> Int -> r) -> r<br />p2Cont f = f 2 8<br /><br />contCont :: ((Int, String) -> r) -> r<br />contCont f = <br /> intCont $ \int -><br /> strCont $ \str -><br /> p2Cont $ \i1 i2 -> <br /> f (int + i1 + i2, str)<br /><br />eval :: (forall a r.(a -> r) -> r) -> a<br />eval f = f idDocKlobihttps://www.blogger.com/profile/18206127999371561868noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-90657730991942535122020-12-23T01:09:05.243-08:002020-12-23T01:09:05.243-08:00Fantastic. Thanks.
Your statement "I remember...Fantastic. Thanks.<br />Your statement "I remember the first time I read the Monad instance for ContT I was so confused ..." is the canonical expression for many issues with the Haskell libraries. It is so "confusing" and obfuscated. It does not seem to be an issue with the ones having a mathematical background but for us bare mortals ... Could be a reason for low acceptance in the wider IT community.<br />It took me years to overcome this problem. And is still not solved completely. Your way of translating / demonstrating it is of immense help.DocKlobihttps://www.blogger.com/profile/18206127999371561868noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-88342520401553308982016-08-15T02:39:50.857-07:002016-08-15T02:39:50.857-07:00I just wanted to say 'thank you' for this ...I just wanted to say 'thank you' for this post. Thanks to your definition the continuation monad is crystal clear to me. This have been in one of tutorials. I can guarantee you that more people would be using the continuation monad if they had seen this definition from the start.MGhttps://www.blogger.com/profile/10379318968029633048noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-46921173866498805712014-04-23T00:56:11.711-07:002014-04-23T00:56:11.711-07:00Thank you, Gabriel and Thaddeus.
Frankly speaking,...Thank you, Gabriel and Thaddeus.<br />Frankly speaking, I thought about reading "How to read Pipes" by Tom Ellis first and looking into pipes 3.2 internals first with a quite simple ProxyF type. But, I'll definitely try to read "Coroutine Pipelines" also.goncharenkohttps://www.blogger.com/profile/09568080141956509298noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-17555677323526402712014-04-22T08:31:31.762-07:002014-04-22T08:31:31.762-07:00Thaddeus replied in a top level comment but I will...Thaddeus replied in a top level comment but I will copy his answer here. You can learn a great deal about how pipes works by reading the "Coroutine Pipelines" article of issue 19 of The Monad Reader:<br /><br />http://themonadreader.files.wordpress.com/2011/10/issue19.pdfGabriel Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-38325942477144177792014-04-22T06:10:34.568-07:002014-04-22T06:10:34.568-07:00read this to understand pipes: http://themonadread...read this to understand pipes: http://themonadreader.files.wordpress.com/2011/10/issue19.pdfAndrew Martinhttps://www.blogger.com/profile/06351785339491331381noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-35829034965018200862014-04-21T01:22:08.255-07:002014-04-21T01:22:08.255-07:00I remember that SPJ also showed that adding some o...I remember that SPJ also showed that adding some omitted function parameters to the both ends of function definition makes lens code much more understandable.<br />But right now I'm trying to understand the internals of pipe (yes - you've already provided great documentation and metaphors, but some time is needed digging source coded in order to get them).goncharenkohttps://www.blogger.com/profile/09568080141956509298noreply@blogger.com