On Fri, Jul 13, 2007 at 09:19:58PM -0300, Felipe Almeida Lessa wrote: > On 7/13/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: >> instance Eval Int where >> ... >> seq (-1) b = b >> seq 0 b = b >> seq 1 b = b >> ... > > I don't think you need all these cases. In fact, you can write > > instance Eval Int where > seq 0 b = b > seq _ b = b [snip long explanation of why this is correct]
I thought of that, but decided that it would just obscure things, so I wrote out an infinite sequence of cases instead. This way it reinforces the symmetry of the instances and doesn't depend on an (often lacking) understanding of the pattern strictness rules. Both are equally valid. Stefan
signature.asc
Description: Digital signature
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe