TrailingString challenge

Wow, implementing this in Haskell was seriously nice