Zhanyong Wan <[EMAIL PROTECTED]> writes: > > How about this: > > makeChanges total coins = > tail $ map fst $ scanl (\(how_many,rest) -> divMod rest) (0,total) coins > > But I doubt this is easier to understand. No, but I hope it will help me getting away a bit for explicit recursion. And it's anyway a better training for me to understand functional programming. > > BTW, your first two branches can be combined: > > makeChange 0 = map (const 0) I added it later, before just one branch was there, it was just playing around a bit to see if I got it ;-) Regards Friedrich -- for e-mail reply remove all after .com
- Another question about higher order functions Friedrich Dominicus
- Re: Another question about higher order functions Zhanyong Wan
- Re: Another question about higher order funct... Friedrich Dominicus
- Re: Another question about higher order functions Paul Hudak
- Re: Another question about higher order functions Zhanyong Wan
- Re: Another question about higher order funct... Zhanyong Wan
- Re: Another question about higher order funct... Friedrich Dominicus
- Re: Another question about higher order functions Friedrich Dominicus
- Re: Another question about higher order functions Benjamin L. Russell
- Re: Another question about higher order funct... Friedrich Dominicus
- RE: Another question about higher order functions Simon Peyton-Jones