Mon Aug 22 21:29:59 CEST 2011
>>= vs. >=>
The monad laws in terms of >=> just say that >=> is associative and
return is the identity:
f >=> (g >=> h) = (f >=> g) >=> h
return >=> f = f >=> return = f
So, why is do-notation (nested >>=) more prevalent? Because it
provides nested variables and sequentiality, the usual playing field
for effectful computations.
Anyways, coming back to my SigOp language, it seems clear now that it
can't be a monad because I want to structure of the computation to be
fixed, because I want to use it to generate static code. Monad is too
ArrowChoice might be an interesting compromise: it allows processors
to be switched into different modes, where they could exhibit
different types. Though it doesn't seem like I really need different
types, just different paths.