[Haskell-cafe] Strange subtract operator behavior - and lazy naturals

John Meacham john at repetae.net
Wed Oct 17 20:23:44 EDT 2007


On Wed, Oct 17, 2007 at 09:16:47PM +0100, Lennart Augustsson wrote:
> The one in the numbers package is not quite as clever as John's; it's the
> naïve version of lazy naturals.

it appears to also be left biased in general, mine are symmetric and
commutative whenever possible and things like its division arn't lazy
when they could be (since it computes the modulus at the same time). 

Another difference is that I use capping behavior at zero rather than
producing an error. This has a variety of nice algebraic properties (in
addition to not bottoming out). unfortunately I can't find the paper
that I read about them at the moment.... hmm...

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-Cafe mailing list