Free algebras, input processes and free monads