fix minor lint
Make PromptSegment it's own data type and make it an instance of Functor and Monoid
minor refactoring to dry up the code