That's an interesting example. I guess a lazy number system like that would work nicely for Deniz's use case.
On Sat, Jun 13, 2009 at 10:26 AM, Stephan Friedrichs<[email protected]> wrote: > Jochem Berndsen wrote: >> Keith Sheppard wrote: >>> Is there any reason that sum isn't strict? I can't think of any case >>> where that is a good thing. >>> >>> Prelude> sum [0 .. 1000000] >>> *** Exception: stack overflow >> >> It is useful if the (+) is nonstrict; although I cannot think of any >> useful mathematical structure where (+) would be nonstrict. > > What about some numeric representations? > > type MyNum = [()] > > instance Num MyNum where > (+) = (++) > > Regards, > Stephan > > -- > > Früher hieß es ja: Ich denke, also bin ich. > Heute weiß man: Es geht auch so. > > - Dieter Nuhr > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- keithsheppard.name _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
