|
|
|
|
|
by chrisseaton
2374 days ago
|
|
> I don’t understand what you’re suggesting with Maybe I’m suggesting adding a trace of where a None value is created and propagated, for debugging purposes. > the primary advantage remains in not having to trust that, not having to write tests for it Is that the primary advantage? I’m not as sure as you seem to be. And of course there’s one huge part of monads that you have to take on trust even in Haskell isn’t there? The monad laws! No type system is enforcing those. If you’re comfortable trusting someone else is following that rule why is trusting they follow another so alien? But if you don’t like the idea don’t worry I’m not going to come round to your house and force you! |
|
It's the combination of that and exhaustive pattern matching that I see as the reason to use strongly-typed functional languages.
>No type system is enforcing those.
This is quite different from not having static type checks at all though. At least with static typing I know that bind and fmap have the correct signature, which is certainly not a verification that they follow _all_ the rules they should (though I am a big fan of dependently typed languages too), yet it is still assurance that the function fulfills a basic premise.
>If you’re comfortable trusting someone else is following that rule why is trusting they follow another so alien?
Because I have seem them betray that trust, over and over again, intentionally and unintentionally, though never actively malicious. Type checking is work the compiler can do for me, so I see no reason to do it myself, where I am known to be rather clumsy and stupid and prone to writing bugs and being human.