tag:blogger.com,1999:blog-1262280623720594573.post5586604999951932082..comments2024-03-29T11:52:20.924+00:00Comments on Dan Ghica's Personal Blog: Haskell: If monads are the solution, what is the problem?Dan Ghicahttp://www.blogger.com/profile/14866637943603692944noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1262280623720594573.post-65004634150040611442018-08-04T09:37:39.913+01:002018-08-04T09:37:39.913+01:00Agreed and I said that in the post although not e...Agreed and I said that in the post although not emphatically. However if a type effect system is what you want, there might be better ways, which achieve more precision than monads. Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-11091256939126591832018-08-04T09:36:00.658+01:002018-08-04T09:36:00.658+01:00Yes, that's true. But not all commutative mona...Yes, that's true. But not all commutative monads are type transparent though. Why? Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-47921880565393687932018-08-04T09:34:43.780+01:002018-08-04T09:34:43.780+01:00Indeed! Sequencing of effects can be lazy but this...Indeed! Sequencing of effects can be lazy but this is not a good thing. I think I said that in the post but not clearly enough. (I recommended the use of bang pattern matching to force evaluation.) Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-27368972140802115922018-08-03T09:31:58.495+01:002018-08-03T09:31:58.495+01:00Nice post.
I think it is also worth noting that wh...Nice post.<br />I think it is also worth noting that what first seems to be a disadvantage: Haskell's lazy evaluation mechanism doesn't allow us to integrate effects into the core language turns out to be an advantage. Monads enable a sort of effect polymorphism: we can easily integrate new effects into Haskell. Examples are quantum computations (the QIO monad) and STM (transactional Thorstenhttps://www.blogger.com/profile/11694920694178035992noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-35834154137211744582018-08-03T08:25:04.043+01:002018-08-03T08:25:04.043+01:00Nice one Dan. I can make the observation technical...Nice one Dan. I can make the observation technical. Partiality, nondeterminism and exceptions (the last one with some trickiness) are *commutative* monads. So, we can get away with a wink. But with state and I/O, we really do need monads.Uday Reddyhttps://www.blogger.com/profile/06821644720218386203noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-3604872025398613512018-08-02T07:24:28.882+01:002018-08-02T07:24:28.882+01:00How does tardis and reverse state monad fit in thi...How does tardis and reverse state monad fit in this interpretation?Marisa Kirisamehttps://www.blogger.com/profile/14315381543475188933noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-58652359089470655832018-08-02T02:41:46.245+01:002018-08-02T02:41:46.245+01:00Hello. I think it is good to point out that even w...Hello. I think it is good to point out that even with Monads Haskell evaluations is not *so* strict. For instance, look at this program:<br /><br />import System.IO<br />main :: IO ()<br />main = do<br /> handle <- openFile "foo.txt" ReadMode<br /> contents <- hGetContents handle<br /> hClose handle<br /> putStr contents<br /><br />Assuming the file "foo.txt" is Anonymoushttps://www.blogger.com/profile/17382112932209995616noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-25165154568512124832018-08-01T14:27:26.248+01:002018-08-01T14:27:26.248+01:00Simon Marlow pointed this paper to me: "A His...Simon Marlow pointed this paper to me: "A History of Haskell: Being Lazy With Class" written by Hudak, Hughes, Peyton-Jones, and Wadler. The relevant sections are 3.2 and 7. I don't think there is technical disagreement between what I am saying and what their paper says on the matter, but maybe the emphasis is a bit different. I hugely recommend the paper, although it has some Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-48612732606483353832018-08-01T12:17:05.877+01:002018-08-01T12:17:05.877+01:00An expert Haskeller pointed out to me that this po...An expert Haskeller pointed out to me that this point has been made by Simon Peyton Jones in "Wearing the hair shirt"! However my elaboration might help understand what he meant. Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-56944008693123166072018-07-31T22:04:16.795+01:002018-07-31T22:04:16.795+01:00Awesome. Priceless insight into the role monads pl...Awesome. Priceless insight into the role monads play with Haskell's default lazy evaluation.Tom Flahertyhttps://www.blogger.com/profile/08256705201252115551noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-76448246266242799482018-07-31T20:21:17.881+01:002018-07-31T20:21:17.881+01:00Reddit haskell thread
https://www.reddit.com/r/has...Reddit haskell thread<br />https://www.reddit.com/r/haskell/comments/939yz4/haskell_if_monads_are_the_solution_what_is_the/Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.comtag:blogger.com,1999:blog-1262280623720594573.post-74184742379705265602018-07-31T07:50:05.439+01:002018-07-31T07:50:05.439+01:00Front page of hacker news!
https://news.ycombinato...Front page of hacker news!<br />https://news.ycombinator.com/item?id=17645277Dan Ghicahttps://www.blogger.com/profile/14866637943603692944noreply@blogger.com