haskell / mtl

The Monad Transformer Library
http://www.haskell.org/haskellwiki/Monad_Transformers
Other
362 stars 63 forks source link

Add laws for MonadState and MonadReader #61

Open Lysxia opened 5 years ago

Lysxia commented 5 years ago

See #5. These two classes are the easiest to think about.

Lysxia commented 5 years ago

Ping @RyanGlScott

RyanGlScott commented 5 years ago

I really don't feel qualified to make a judgment about whether these should be the laws for these classes, which is why I haven't taken action. It might be worthwhile to bring up this topic on the Haskell libraries mailing list in order to garner a consensus (which I'd find convincing).

Lysxia commented 5 years ago

I see, thanks for your input! I will start a discussion on the mailing list.

hanshoglund commented 4 years ago

@Lysxia @RyanGlScott Any updates?

Lysxia commented 4 years ago

This is still WIP. On the mailing list it was suggested to investigate the matter more formally. So I started studying those laws in Coq: https://github.com/Lysxia/coq-mtl but I've been distracted by other things lately.

The situation, as I understand it, is that there is no formal definition of the mtl classes, and there is no objective criterion for what makes a law "good" or "bad". Through the formalization, the hope is to get a better understanding of how the laws relate to each other, and ideally to tease out some nice structure that could convincingly be considered the "essence" of mtl.

I'd be interested to hear about other people's motivations to have these laws documented.

hanshoglund commented 4 years ago

How about adopting the uncontroversial idea that reader, writer and state are monad homomorphisms as a starting point?

Lysxia commented 4 years ago

It's been a week since I reiterated my proposal: https://mail.haskell.org/pipermail/libraries/2019-October/030038.html

Is there anything more I can do to make progress to get this merged?