Removed redundant newlines and whitespace.
Reordered imports.
Consistent export layout.
Use LANGUAGE pragma instead of OPTIONS and -X.
Consistent use of type variables.
Eta-reduce function definitions.
Removed redundant return.
Removed redundant do-notations.
Use const.
Use maybe.
Use unless.
Use liftM2.
Minor layout tweaks to improve readability.
Improved comment layout for readability.