
7 Jun
2011
7 Jun
'11
7:05 a.m.
On 6/6/11 7:05 PM, Casey McCann wrote:
On Mon, Jun 6, 2011 at 5:32 PM, Matthew Steele
wrote: branchApplicative = liftA3 (\b t f -> if b then t else f)
This definition doesn't satisfy the laws given for the Branching class; it will execute the effects of both branches regardless of which is chosen.
How would it violate the laws for Identity or Reader?
It wouldn't violate the laws for those (or other benign effects, given a suitable definition of "benign"), but it'd clearly violate the laws for things like Writer, ST, IO,... -- Live well, ~wren