On 6/6/11 7:05 PM, Casey McCann wrote:
On Mon, Jun 6, 2011 at 5:32 PM, Matthew Steele<mdste...@alum.mit.edu>  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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to