Submitting Unison exercises

Trying to work on the Unison track exercises locally. I have pulled in the exercism namespace successfully and solved a couple of exercises, ran the tests etc.

Now I’m stumped on how to submit the results. There are no files to submit, and the namespace doesn’t seem to have anything but the exercises. How should I submit my work, besides copy-pasting code to the web editor?

Seems as the documentation suggests to use files.

Disclaimer: I have no experience in using unison. But to use files feels natural to me.

It seems that Unison Share does indeed provide an exercism namespace. I’m not sure how that namespace is intended to be used, but it seems to me that if you are going to use the namespace the best approach would be to copy the code to the web editor indeed.

For a more file-based approach, you probably don’t want to use the namespace directly and instead use the Exercism CLI: Working Locally, which will download each exercise into its folder and does provide a file to interact with the codebase manager. In addition to the link @NobbZ posted, also check Testing in the Unison track that provides more info on how to run the tests with the files downloaded by the CLI.

PS: Also not an expert in Unison, I just know the basics of making the first exercises on the track a few months ago.


I think the confusion here is that in Unison when you download an external package like the exercism one, you don’t really get files. Instead, a local database with the code is updated and you use the unison codebase manager to interact with that database. Files can be optionally used as intermediate representations of the code to update the database, but ultimately unison only cares about the code saved in AST form in the database.

1 Like

Hello! Unison Exercism track maintainer here! Thank you @andrefcsantos for filling in the info about pulling an external namespace from Unison share! :smiley: There’s an interesting difference in the Unison language as a whole in that the files in which you might write Unison code are ephemeral. When you’re doing a particular exercise, you might pull the Exercism stubs namespace from Unison share, and work on your implementation locally in a scratch.u file which you can delete and recreate at any point. One way to get your code back into a file format for submission is to run edit myFunction1 myFunction2 ... myFuncitonN and the UCM will write the implementations to the last opened .u suffixed file. Then you can use the the Exercism CLI to download the expected file structure for the Exercism test runner and copy your implementations into the file.

I realize that’s a bit of an odd workflow so I may have to do some thinking about if I can make that more seamless. In the future we’ll likely have cooler reflection and codebase manipulation abilities so we could do something like programmatically write Unison code to the expected CLI submission location.

Thanks for giving it a try as we figure out how our language integrates with other systems! It’s super helpful!


I figured the edit workaround while doing another exercise. The hard part is that you must not forget to include all the bits. Now trying to figure out if it is easy to diff states and extract dependencies easily.

Newbie problems, but it may be a good idea to write some help doc about it.

Perhaps we could help you provide a script to students that people run instead that does the majority of the work?