[Haskell-beginners] Re: Integer factorization

Colin Paul Adams colin at colina.demon.co.uk
Fri Mar 13 07:25:18 EDT 2009


>>>>> "Heinrich" == Heinrich Apfelmus <apfelmus at quantentunnel.de> writes:

    Heinrich> Abstraction is the one driving force for very short
    Heinrich> names. For example, take the definition of foldr

    Heinrich>    foldr f z [] = z foldr f z (x:xs) = f x (foldr f z
    Heinrich> xs)

    Heinrich> Since this function is polymorphic, so f , z and the xs
    Heinrich> can be anything, using more "descriptive" variable names
    Heinrich> is simply not possible; the key point of fold is its
    Heinrich> generality.

Wouldn't unit be a better descriptive name than z?
-- 
Colin Adams
Preston Lancashire


More information about the Beginners mailing list