Skip to content

Do not allow capabilities in parsing and syntax check#201

Merged
patritzenfeld merged 13 commits intomainfrom
parse-identity
Feb 12, 2026
Merged

Do not allow capabilities in parsing and syntax check#201
patritzenfeld merged 13 commits intomainfrom
parse-identity

Conversation

@patritzenfeld
Copy link
Copy Markdown
Member

This now runs in the Identity Monad. Afterwards the checks continue in IO.

@patritzenfeld patritzenfeld linked an issue Feb 10, 2026 that may be closed by this pull request
@patritzenfeld patritzenfeld marked this pull request as ready for review February 10, 2026 15:57
Comment thread flex-tasks/src/FlexTask/Interpreter/EvaluationHelper.hs Outdated
Comment thread test-flex-action/components/runGhci.expect
@jvoigtlaender
Copy link
Copy Markdown
Member

Come to think of it, do we actually anywhere (in modelling-tasks, logic-tasks ... any existing custom flex tasks) have a case where the syntax check requires any of MonadCache, MonadLatexSvg, MonadGraphviz, MonadDiagrams, MonadAlloy, MonadWriteFile either?

@patritzenfeld
Copy link
Copy Markdown
Member Author

patritzenfeld commented Feb 11, 2026

Come to think of it, do we actually anywhere (in modelling-tasks, logic-tasks ... any existing custom flex tasks) have a case where the syntax check requires any of MonadCache, MonadLatexSvg, MonadGraphviz, MonadDiagrams, MonadAlloy, MonadWriteFile either?

  • composeFormula's flex version has both MonadLatexSvg and MonadCache for the tree images.
  • petri-reverse-reach from ba-pei-ching has MonadDiagrams and MonadGraphviz
  • MonadAlloy is never used outside the generation
  • MonadPlantUml and MonadWriteFile aren't used at all, but this could come up later. They will appear there if we do flex versions of activity diagram tasks.

Comment thread flex-tasks/src/FlexTask/Interpreter/EvaluationHelper.hs Outdated
@jvoigtlaender
Copy link
Copy Markdown
Member

Note that I said:

the syntax check

@jvoigtlaender
Copy link
Copy Markdown
Member

@patritzenfeld
Copy link
Copy Markdown
Member Author

patritzenfeld commented Feb 11, 2026

Oh sorry. The syntax check seems to be vanilla OutputCapable in all flex-tasks at the moment. So should this be changed to run in Identity as well?

@jvoigtlaender
Copy link
Copy Markdown
Member

Identity or potentially Either (if throwing/error handling is needed)? Or is error handling never (also not during parsing) surfacing at that level, because it will instead be put into the LangM part?

More invasively, maybe, the FilePath argument of syntax checkers could then be removed.

(Indeed, on a conceptual level, one could say: The syntax checks should be things that in principle could happen on the client side, with form verification / JavaScript. So indeed, they should not have access to files, IO command execution etc.)

@patritzenfeld
Copy link
Copy Markdown
Member Author

An error could be thrown during parsing if parseInfallibly (which assumes the parse will always work and quits on failure) is used incorrectly. In other cases, the ParseError will be processed and embedded into LangM.

But I think you didn't mean that, but rather some way to communicate the ParseError? Then I think Either won't be necessary.

@jvoigtlaender
Copy link
Copy Markdown
Member

Yes.

In any case, sooner or later the type checker would tell us about our wrong assumption if we now go with Identity but actually something "stronger" like Either would have been needed (since Identity will lack some relevant class instance).

Comment thread flex-tasks/src/FlexTask/Interpreter/EvaluationHelper.hs Outdated
@patritzenfeld
Copy link
Copy Markdown
Member Author

patritzenfeld commented Feb 11, 2026

I replaced the case now after all, because mapM is no longer confusing the reader by ignoring the function's argument.

@patritzenfeld patritzenfeld changed the title Do not allow capabilities when parsing Do not allow capabilities in parsing and syntax check Feb 12, 2026
@patritzenfeld patritzenfeld merged commit 87ee2a0 into main Feb 12, 2026
24 checks passed
@patritzenfeld patritzenfeld deleted the parse-identity branch February 12, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make parseSubmission run in Identity Monad?

2 participants