[Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Albert Y. C. Lai
When I was writing http://www.vex.net/~trebla/haskell/crossroad.xhtml I wanted to write: branching on predicates and then using selectors is less efficient than pattern matching, since selectors repeat the tests already done by predicates. It is only ethical to verify this claim before

Re: [Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Edward Z. Yang
Note that, unfortunately, GHC's exhaustiveness checker is *not* good enough to figure out that your predicates are covering. :o) Perhaps there is an improvement to be had here. Edward Excerpts from Albert Y. C. Lai's message of Mon Apr 22 00:51:46 -0700 2013: When I was writing