On Wed, Aug 24, 2011 at 3:47 PM, Ivan Lazar Miljenovic
<[email protected]> wrote:
> I was just trying to remember some of the tricks Daniel Peebles (aka
> {co}pumpkin) used to do in #haskell with Data.List.genericLength.
> I've never really used ListLike, but was just trying to guess why the
> default implementation was as it is.

Maybe he used lazy implementations of Num and Ord in combination with
a definition like

    length [] = 0
    length (_:xs) = 1 + length xs

But as John observed, the accumulating version of length does not
provide such laziness and the accumulator might as well be made
strict.

Sebastian

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to