Re:Scalable Program Architectures
by prutschman on Monday April 14, 2014 @10:46PM
(#7590060)
The important part of what I guess you could call algebraically structured combinators is that they must follow certain laws. A type system can certainly help enforce at least a subset of those laws, but you're right that you don't have to have one in order to make use of the structures.
Where you lose me is in saying both that a basic understanding of abstract algebra is helpful and that monoids are part of the "smoke and mirrors"; I'd consider monoids a part of a basic understanding of abstract algebra.
Re:Scalable Program Architectures
by dkarapetyan on Tuesday April 15, 2014 @02:25AM
(#7590571)
Poor choice of words on my part. Yes, monoids are indeed a very basic kind of algebraic structure but the tutorials for these structures are always in a language like haskell where the actual simplicity of the concepts gets lost behind the type system. Type systems in my mind are logical structures and even though there is a very close relationship between algebra and logic one doesn't always have to tie the algebraic structures to some kind of type system to make sense of them.
Re:Scalable Program Architectures
by prutschman on Tuesday April 15, 2014 @05:23PM
(#7594397)
Nods. The nice part about the type system is that it can automatically reject (some) misuses of the structures. I've found that helpful while learning some of these things as it can let me know that I don't actually understand something that I thought I had. I agree that emphasizing the typed aspect can do an injustice to the other algebraic properties.
I find it a little annoying that the general principles get lost behind smoke and mirrors like monoids and monads when things are in fact much more accessible and do not require anything other than some basic understanding of abstract algebra. It's the algebraic and not the fancy static types approach that has paid the most dividends when it comes to how I structure my code for readability and maintainability.