The guts of our coin changer will be a make_change function which takes a list of coins and an amount to be made into change.
This make_change function will work with the monadic object recurs amt which must be given the amount we want distributed and whose runStateT function is ready to do the distributing provided it is passed the starting list of coins we have available. It is almost easy to define make_change
except that the monadic object produced this way is an IO Int and not an IO () as required. A small tweak fixes that
All that is left is to write main and next_coin. Because next_coin works with both amount and coins the implementation will have to work with StateT's get and put. Recall they are defined to work as if StateT were a State monad.