tag:blogger.com,1999:blog-1777990983847811806.post4451582993468121707..comments2024-03-16T16:29:29.582-07:00Comments on Haskell for all: What is a monad morphism (in Haskell)?Gabriella Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1777990983847811806.post-62185476602111801742022-03-15T18:03:09.537-07:002022-03-15T18:03:09.537-07:00Thanks for this post! I was not familiar with thi...Thanks for this post! I was not familiar with this concept in Haskell. Your explanations are really helpful. It is great to see the connection to functors.Aaron Stumphttps://www.blogger.com/profile/07755432667897016469noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-91428980615591005952022-02-28T09:04:48.259-08:002022-02-28T09:04:48.259-08:00You're right. I updated the post to note that...You're right. I updated the post to note that listToMaybe is not a monad morphismGabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-66140268201617938662022-02-28T07:46:18.416-08:002022-02-28T07:46:18.416-08:00Nitpick: I don't think `listToMaybe` is a mona...Nitpick: I don't think `listToMaybe` is a monad homomorphism. Let `f :: Int -> [Int]` be defined by `f x = if x == 0 then [] else [x]` and let `m = [0, 1]`. Then `listToMaybe (do { x <- m; f x })` is `Just 1` but `do { x <- listToMaybe m; listToMaybe (f x) }` is `Nothing`. Maybe you were thinking of `MaybeToList` which is a monad homomorphism? On the other hand `listToMaybe` is a homomorphism but for a differnet monoidal structure. It is an applicative homomorphism.Sonat Süerhttps://www.blogger.com/profile/17037984617754516377noreply@blogger.com