A basic read-eval-print loop
@ prompt the prompt to show
@ onInput the function to run on reading input, returning a String to
output
A basic read-eval-print loop, maintaining a state
@ state the input state
@ prompt the prompt to show
@ onInput the function to run on reading input, returning a String to
output and a new state. Returns Nothing if the repl should exit