by metanonsense · 1y ago · 0 comments
Yes, they’re encoded in Haskell, but they’re the same monad laws from category theory.
They are incredibly complicated, comprising papers of tens to hundreds of pages, and either extremely language specific, usually only formalizing a portion of the full language, or general but too limited to specify the behavior of real world languages.
The two are not comparable.
I’m also not aware of any general formalization of MVC or how one would even begin to approach a canonical definition, much less formalization.
You define it by defining Model, View, and Controller and how they interact with each other. For example take a look at the diagram from the article.
There's really no comparison. Monads have a very small and simple definition. That's not true of either OOP or MVC. Formalizations of OOP do exist - they're complex and messy and mainly serve to demonstrate how poorly motivated classic OOP is.
Ultimately they are expressed in code by either the compiler or a framework. If you just want a high level formalization I don't think it would be that complex or messy.
The laws are mathematical ones, that can't be expressed in the Haskell type system.
> And at some point the original meaning got lost
This is false. The original meaning is a mathematical one, and its use in Haskell conforms to that.
That meaning is not "lost", it's the only valid and rigorous definition there is. People who think the meaning is lost are simply ignorant. All they would have to do to correct that ignorance is a minimal amount of research.