Can you add a test here where a pattern guard has a side-effect and make sure it is only called once? With the current implementation it is (at least in the test thing I hacked together), but I have not the slightest idea how it actually works. We should test for regression.