Remix.run Logo
frumplestlatz 4 days ago

I see that your comment is now downvoted into the negatives.

When people are confused by something, they will often blame the target of their confusion instead of admitting to themselves that they don’t understand.

hurril 4 days ago | parent [-]

You both have good points. But there is monads the mathematical and programmatic concept, and there is also something a little bit handwavy in how these things are incorporated into an application architecture. The latter is what is being used on the one hand in comparison to MVC, etc, on the other.

I.e.: a monadic architecture in Haskell is good, but one in Java is going to suck. A sort of half-way point is in The Elm Architecture, which is a sort of deconstructed IO monad.

(Writing this as someone with decades of experience in writing monadic architectures.)

yakshaving_jgt 4 days ago | parent | next [-]

What does a “monadic architecture” look like? I’ve been writing web applications in Haskell for the past decade and all of them are MVC.

hurril 3 days ago | parent [-]

I am going to interpret your question as one asked in good spirit.

I like this book: https://www.manning.com/books/functional-design-and-architec...

yakshaving_jgt 3 days ago | parent [-]

> I am going to interpret your question as one asked in good spirit.

Thanks. It was.

> I like this book

I have that book, but I haven't read it. Which part specifically should I look at to understand what you mean by "monadic architecture"? Or do I need to read the entire book first? I'm searching through that book right now, and as far as I can tell, it doesn't mention "monadic architecture" even once.

hurril 3 days ago | parent [-]

An architecture that consists of monads.

yakshaving_jgt 3 days ago | parent [-]

That doesn't really tell me anything though. I use monads, and applicatives, and functors, and monoids, semigroups, etc

When you use Hakyll to generate a static site, you use a bunch of monads. But is a Hakyll site a "monadic architecture"? I'm not quite sure how I'd describe it as an architecture — it's really just an imperative program. It's to some degree a bit like a Makefile.

A Yesod application on the other hand I would readily describe as MVC, and yet it's all monads all over the place.

What about something like The Elm Architecture? Elm provides a bunch of monads (not directly as an abstraction, but through a few specific instances) but its architecture I would describe as perhaps FRP, or unidirectional data flow state machine kinda thing.

So that's three examples with clearly distinct architectures, and all three are architectures that "consist of monads".

So, I don't really understand what "monadic architecture" means.

frumplestlatz 4 days ago | parent | prev [-]

I don’t really understand what a “monadic architecture” is supposed to mean.

Haskell’s `Monad` type class is hardly the only possible encoding of a monad. They’re just a simple mathematical construction with useful properties, and — like functors and applicative functors — they emerge everywhere.

hurril 3 days ago | parent [-]

See, I don't think you don't really understand my point. I said this elsewhere: I have been programming Scala and Haskell for more than 15 years, which I am sure you have as well. This is not ment as a proof of my point as that would be arguing form authority. This is not my intention. But there are more things at play here.

What I think you are doing is: well quantum mechanics is just simple mathematical construction and some artithmetic.

Is it really? Is it _just_ that?