|
|
|
|
|
by jolux
2374 days ago
|
|
Yes I’m aware they’re monads, my primary languages are OCaml and Haskell. I don’t understand what you’re suggesting with Maybe, that sounds like maybe adding some layer of magic onto it? > Yes people can do anything, but usually they follow the rules they're given. Sure, but the primary advantage remains in not having to trust that, not having to write tests for it, and communicating the contract itself inside the code it restricts. I’m just honestly not sure what purpose they serve here, and why you’d bother to call them monads when what you really seem to want is the stored debugging information. |
|
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!