tag:blogger.com,1999:blog-1777990983847811806.post5223910235711938686..comments2024-08-09T01:24:32.987-07:00Comments on Haskell for all: Mathematical APIsGabriella Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1777990983847811806.post-14845755852263214582015-10-21T10:15:04.536-07:002015-10-21T10:15:04.536-07:00These streams seem to be ordered though, which wou...These streams seem to be ordered though, which would mean that a + b != b + a and that violates commutativity. Of course, that's just because we haven't defined the equivalence relation as one that doesn't care about the order of elements in the stream. Intuitively, all we can go on is that the outcomes are possible to distinguish some way, ie that there is a valid equivalence relation for which + does not commute.Anonymoushttps://www.blogger.com/profile/01938458104516754843noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-6441405251744515772015-10-21T10:14:40.417-07:002015-10-21T10:14:40.417-07:00These streams seem to be ordered though, which wou...These streams seem to be ordered though, which would mean that a + b != b + a and that violates commutativity. Of course, that's just because we haven't defined the equivalence relation as one that doesn't care about the order of elements in the stream. Intuitively, all we can go on is that the outcomes are possible to distinguish some way, ie that there is a valid equivalence relation for which + does not commute.Anonymoushttps://www.blogger.com/profile/01938458104516754843noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-29577536349807460212015-04-07T09:50:30.545-07:002015-04-07T09:50:30.545-07:00I don't understand what you mean when you say ...I don't understand what you mean when you say there are not many interesting laws. (+) is associative and its identity is 0. (*) is associative and its identity is 1. (*) right-distributes over (+).Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-34878854248792563862015-04-07T04:39:12.358-07:002015-04-07T04:39:12.358-07:00Operations (+) and (*) should be reserved for numb...Operations (+) and (*) should be reserved for number-like stuff (rings or some of their generalizations). Using it for streams is very confusing as not many interesting laws hold here (ultimately this stems from (+) not being commutative).<br /><br />I give you that it does seem like a clever idea initially, but eventually it fails precisely because there is no mathematical structure here (kind of ironic given the title of this post).<br /><br />It very much reminds me of using instances (e.g. for Monad) for stuff that is not because it fails some of the laws. I think not many people bother to check the laws actually. They assume that if it binds like a duck and returns like a duck, it must be a duck. But does it associate like the duck? That's the real question!twoldhttps://www.blogger.com/profile/07368869740412839184noreply@blogger.com