Conversation
|
Actually, I'm a bit unsatisfied with the You mentioned the The concrete implementation of the eval argument also gets needlessly complicated because of this, due to needing to check the outcome of the syntax phase explicitly. If it is changed to eval = runReason . (setReason Syntax >=> setReason Semantics))Instead of having a case distinction that cannot use the composability of the Reporter Monad (this code is a bit raw): eval checks = do
(syntaxResult, syntaxOutput) <- runReason $ setReason Syntax checks
case syntaxResult of
Left r ->
...
Right semantics -> do
semanticsResult <- runReason $ setReason Semantics semantics
return ...I should probably have noticed this sooner, but I'd be in favour of changing this back to a plain |
|
Okay, go ahead. |
|
Maybe deferred to a separate PR: a config option that can be set to turn off the semantics phase (whatever that phase is, according to the split-phases setting). One use-case: configuring a task complete with test suite etc., but turning the semantics stuff off during an exam setting (not only hiding the semantics output, but really preventing its possibly costly computation), but being able to simply turn it on after the fact. |
|
As another iteration on the API here: What about replacing Instead of: eval $ do
…
sequence_ syntax
return $ sequence_ semanticsthe implementation would then be: do
…
withSyntax (sequence_ syntax)
withSemantics (sequence_ semantics)(Still need to consider whether the In the test suite, the usage would be From Autotool, the usage would be And the config option in #41 could be realized by conditionally setting |
gradesyntaxCutoffoption