GNU ed subset in Haskell (written as deliverable of an intro to FP course)