agocorona / MFlow

(Haskell) Web application server with stateful, type safe user interactions and widget combinators
http://mflowdemo.herokuapp.com
Other
100 stars 12 forks source link

BackT in MFlow is not a monad #61

Closed ninegua closed 9 years ago

ninegua commented 9 years ago

Not sure if this has been brought up before, but I was reading the paper MFlow, a contiuation-based web framework without continuations In The Monad Reader Issue 23, and noticed that the BackT type violates associativity law of monads, because (a >> b) >> c behaves differently than a >> (b >> c). You can see my code that demonstrates this issue.

Not sure how much the real MFlow implementation differs from the paper as I have not used it nor read its source.

agocorona commented 9 years ago

Hi Paul. Yes I has been mentioned, but thanks a lot for mentioning it.

This produces effects that precludes the use of the backT monad for other purposes. in MFlow it is used internally for navigation and perform backtracking well in combination with REST path navigation.

But I found another way to do backtracking that is more general and flexible. It Will be at the new version of MFlow. hat mechanism is described in this article:

https://www.fpcomplete.com/user/agocorona/the-hardworking-programmer-ii-practical-backtracking-to-undo-actions

(At this moment this mechanism is under research, since it is quite unusual and is an unexplored territory. I found some problems with the associative law that are now fixed in my local PC)

How did you know about MFlow?

2015-05-02 9:32 GMT+02:00 Paul Liu notifications@github.com:

Not sure if this has been brought up before, but I was reading the paper MFlow, a contiuation-based web framework without continuations https://themonadreader.files.wordpress.com/2014/04/mflow.pdf In The Monad Reader Issue 23 https://themonadreader.wordpress.com/2014/04/23/issue-23/, and noticed that the BackT type violates associativity law of monads, because (a >> b) >> c behaves differently than a >> (b >> c). You can see my code that demonstrates this issue https://gist.github.com/ninegua/97833cb4f82451f6c3db.

Not sure how much the real MFlow implementation differs from the paper as I have not used it nor read its source.

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/issues/61.

Alberto.

ninegua commented 9 years ago

Thanks for the update. I joined a Chinese reader group that studies The Monad Reader articles in weekly or bi-weekly online meetups. We discussed the MFlow paper last week, and that was how I came to find out more about it. Fascinating read, and keep up the good work!