Uses a WriterT monad transformer on the TC monad stack to implement pretty-printing of constraint information regardless of success or failure of type-checking. Fully working, some points to note:
I did not modify the Monad.hs file to export the WriterT monad's tell and when functions. This could be done to avoid having to import them separately in code using the TC monad, perhaps through wrapper functions.
I combine the pretty-printed output and any errors that result through a simple string concatenation. If the errors are pretty-printed later, this code would have to change. Let me know if this has to be modified.
Uses a WriterT monad transformer on the TC monad stack to implement pretty-printing of constraint information regardless of success or failure of type-checking. Fully working, some points to note:
tell
andwhen
functions. This could be done to avoid having to import them separately in code using the TC monad, perhaps through wrapper functions.