> As you might know, I'm working to find my way through Haskell
> using School of Expression from Paul Hudak.  I have done all
> the examples up to chapter 5.  I do think I've learned quite
> a bit.  But again I'm wondering if this:
> 
> makeChange :: Int -> [Int] -> [Int]
> makeChange 0 (c:coins) = 0:makeChange 0 coins
> makeChange 0 [] = []
> makeChange n (coin_val:coins) = 
>   let (how_many,rest) = divMod n coin_val
>   in   how_many : makeChange rest coins
> 
> could be replaces by some combination of HOFs.  Could someone
> give me a hand here?

Without even thinking about whether your program correctly solves
exercise 5.9, here are two hints on how to use HOF's:  First note that
divMod 0 n = (0,0).  Then consider using the HOF scan (see page 326).

  -Paul

Reply via email to