a breaking monad
Derek Elkins
ddarius@hotpop.com
Thu, 31 Jul 2003 17:15:33 -0400
On Thu, 31 Jul 2003 13:18:40 -0700
"Hal Daume" <t-hald@microsoft.com> wrote:
> so, my questions are: does this exist in some other form I'm not aware
> of? is there something fundamentally broken about this (sorry for the
> pun)? any other comments, suggestions?
This looks like a bizarre rendition of the Error/Exception monad.
I believe the function "breakable" would be fairly accurately
represented with '\b -> runErrorT b >>= either return return' and use
throwError for break.
Also, your motivating example is ambiguous. I think you mainly care
about the case where the test is testing for some "exceptional"
condition. I personally wouldn't want to use this style every place I
would use an if.