applyAll ::[(a -> a)]-> a -> a
applyAll [] x = x
applyAll (f:fs) x = f (applyAll fs x)

applyAll :: [(a -> a)] -> a -> a
applyAll [] x = x
applyAll (f:fs) x = f (applyAll fs x)

This entry was posted on Wednesday, August 8th, 2007 at 10:35 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

applyAll fs x = foldr id x fs

applyAll fs x = foldr ($) x fs

applyAll = foldr (.) id

id, ($), (.) and \ aren’t introduced until later in the text, using concepts only from 9.1 and earlier, one answer would be:

applyAll :: [(a -> a)] -> a -> a

applyAll = flip (foldr aux)

where aux f x = f x