Content deleted Content added
m forgot to indent...fixed |
A couple replies |
||
Line 102:
Also, in the Analysis section, I think we should explicitly state the types of <code>ma</code>, <code>mmma</code>, etc, to avoid confusion (I found it hard to work out). --[[User:Jordan Mitchell Barrett|Jordan Mitchell Barrett]] ([[User talk:Jordan Mitchell Barrett|talk]]) 21:11, 16 September 2021 (UTC)
:Hi there, first off, the : symbol is actually one bit I really didn't think through much. IIRC Haskell uses it for type signatures, and it's not that different from its use in plain English or function signatures in math. So I just ran with it without thinking too much about it; if some inconsistency jumps out at you, I don't see a reason not to change it.
:As for the the use of <code>ma</code> in the Analysis section, I'm not sure I follow about making the types explicit. Do you mean include the signatures in an expanded form? I tried to stay concise, but if you think adding some details clarifies things, that's always an improvement.
:It is a little tricky because the laws are pretty generic, as long as <code>m</code> is monadic and the same variable means the same thing on both sides of an expression. Repeating the variable for the monad type was the simplest way I could think of to express the nesting you see in the laws (and like in the List example, when you're in that transition state after mapping the monadic function but before reducing again with join). [[User:Zar2gar1|Zar2gar1]] ([[User talk:Zar2gar1|talk]]) 21:24, 25 October 2021 (UTC)
== IFF or equality? ==
Maybe I'm just being dumb bc I'm just a mathematician who doesn't do category theory and may be unfamiliar with some of the programming/category theory specific notation but shouldn't the statement of the Monad laws use an equals symbol not a double arrow (as it appears in iPhone Wikipedia app)? If it is correct as written it might help to add a note explaining that it's not meant to be read as the usual logical connective. [[User:Peter M Gerdes|Peter M. Gerdes]] ([[User talk:Peter M Gerdes|talk]]) 16:06, 2 October 2021 (UTC)
:No, you're definitely not being dumb or missing some deep secret; while the choice was intentional, it was mainly a compromise for the pseudocode. I thought it could act as a (metalanguage?) hint that the monad laws aren't necessarily programmed, but ultimately logical propositions about a potential monad. They may or may not be true, based on whether the object is actually verified to be a monad.
:If anyone wants to change it, I'm definitely not opposed. I'd just stay away from the single = sign since that's used for assignment in so many programming contexts, but a == or === is pretty common for equality in several languages. Ideally though, we'd still want to emphasize the laws (typically) aren't checked within the program, but outside of it logically. [[User:Zar2gar1|Zar2gar1]] ([[User talk:Zar2gar1|talk]]) 21:24, 25 October 2021 (UTC)
|