Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This one did not have any test cases in the problem specs, so I had very little guidance.
The goal of the exercise is to implement a DSL that looks like the Dot format:
The DSL I came up with looks close enough:
However, I feel like the fun and interesting part was designing this DSL. Now the users just need to implement the
buildGraph
function that reads the DSL commands and builds a graph: it's okay, but not super interesting, IMHO. Perhaps it's enough to get the users familiar with the idea of a DSL and how to build one in Roc.Another option would be to make the tests agnostic to the DSL itself, as long as it can build the right graphs. For example:
This way the user gets to come up with their own DSL, which is the interesting part, and they also get to use it to build a few graphs. But perhaps this does not give users enough guidance. They could just define
dslCommandsForGraph1
to be equal to the expected graph 1, and makebuildGraph
the identity function, it wouldn't be very interesting. Or perhaps we can guide them a little bit in the docs, by suggesting a DSL like the one I designed. I'm not sure, WDYT?Note: if we stick to the current approach, perhaps I can add a test that requires the user to use the DSL to build a specific graph? For example: