Always emit a (possibly empty) list of warnings and move the CaseModeCheck before the TypeCheck
This addresses #155 by:
-
Swapping
WriterT
andExceptT
in theCYT
monad transformer to make sure that warnings are always emitted, even when the compilation fails.Moving the
ExceptT
to the outermost (or innermost, depending on the viewpoint) layer of the transformer stack changes the result type fromerrors warnings v v Either [Message] (a, [Message])
to
errors warnings v v (Either [Message] a, [Message])
Notably this is a source-breaking change for any clients consuming the Curry frontend as a library. I believe, however, that emitting warnings even when the compilation fails is a good idea in general and worth the potentially required downstream changes. Internally it is a rather small change anyway since the helper methods around the
CYT
monads are already well-abstracted. -
Moving the
CaseModeCheck
after theSyntaxCheck
. This makes sure that types and values are disambiguated correctly, while making sure the warnings are generated before the type check.
I have also updated the unit