[Haskell-cafe] Wow Monads!

Sergiu Ivanov sivanov at colimite.fr
Wed Apr 19 16:11:19 UTC 2017


Thus quoth  MarLinn  at 15:10 on Wed, Apr 19 2017:
> On 2017-04-19 15:58, Joachim Durchholz wrote:
>> Am 19.04.2017 um 15:13 schrieb Sergiu Ivanov:
>>> However, there are a couple big "backdoors", like the IO monad.
>>
>> Well, it's so awkward that people don't *want* to use it.
>
> That's partly because IO isn't very well defined, and therefore used as
> a catch-all. It's like the "other mail" folder, a stuff-drawer in the
> kitchen or that one room in the basement: random things tend to
> accumulate and rot in there because they don't have a better place.

Exactly.

> One of the worst offenders from my perspective is (non-)determinism.

Oh, right, interesting!

> Randomness can be seen as non-deterministic, but it doesn't need IO. At
> the same time, many things that are in IO are practically not less
> deterministic than pure functions with _|_ – once you have a good enough
> model. In other words, these things could be separated. It needs work,
> to model the real world, to go through all the stuff that's in that
> black box, to convince people to not use IO if they don't need to, to
> change the systems to even allow "alternative IOs"… so it's nothing
> that'll change soon.

I tend to see monads like STM (software transactional memory) and ST
(strict state threads) as a kind of "add structure to IO" effort.

Also, there's Eff (algebraic effects), but I still haven't had the time
to read the seminal work beyond introduction:

  http://www.eff-lang.org/


> IO is the elephant in the room of type-supported hopes of correctness.

I like this image :-)

--
Sergiu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170419/fbcfdb69/attachment.sig>


More information about the Haskell-Cafe mailing list