I don't know exactly what format this is parsing, but would the [split](http://hackage.haskell.org/package/split) package help make this simpler?  It is in the platform (or will be soon?) and is a very reasonable dependency that I wouldn't mind adding