Rumca
Rumca

Reputation: 1829

Are monads current "state of the art" to do IO in pure languages?

I am wondering whether there are any new approaches considered as viable (better) alternative to Haskell's Monad IO that has been around for many years.

Upvotes: 3

Views: 403

Answers (2)

atravers
atravers

Reputation: 495

Is monadic I/O currently the "state of the art" in pure languages?

By itself? No - abstracting away I/O behind a monadic interface has been happening for close to 30 years.

What is new are abstractions over monadic I/O such as iteratees; Owen Stpehens provides more details in his overview Approaches to Functional I/O. He summarises the current situation:

I/O is not a particularly active area of research, but new approaches are still being discovered [...]

Ben Lynn makes a similar observation:

And now that we can write mostly pure code with occasional impure wrappers, researchers have mostly stopped seeking superior alternatives.

Conal Elliott describes it quite memorably:

With the invention and acceptance of monadic imperative programming, it's like the Haskell community wandered into an opium den and are still lying there in a fog.

Okay, I may be exaggerating a bit. Some are in rehab, and some "didn't inhale".

It was the ugliness of dialogues that helped to propel the monadic interface to such prominence - could monadic I/O ever be considered ugly enough to give rise to an all-new replacement?

Only time will tell...

Upvotes: 1

nponeccop
nponeccop

Reputation: 13677

The main alternatives are effect systems. See http://www.cse.unsw.edu.au/~benl/papers/thesis/lippmeier-impure-world.pdf for an example. There are many of them, so your question cannot be sensibly answered. See also What is a type and effect system?

Upvotes: 1

Related Questions