Show an interactive haskell program

I'm trying to show how you might make this into a command line program - you might be interested to see how imperative/structured programming works in Haskell.