granule-project / granule

A statically-typed linear functional language with graded modal types for fine-grained program reasoning
https://granule-project.github.io
BSD 3-Clause "New" or "Revised" License
589 stars 33 forks source link

Spurious `()` in stdout #230

Closed rzuckerm closed 5 months ago

rzuckerm commented 10 months ago

I have this simple program:

main : () <{Stdout}>
main = toStdout "Hello, world!\n"

When I run this:

$ gr --no-info hello_world.gr

I see this:

Hello, world!
()

Is there any way to get rid of the suprious () in the output? I am using the 0.9.4.0 of the granule compiler on Ubuntu 22.04. I installed this by unzipping the Linux x86-64 zip file I've looked through all the options, and I don't see anyway to get rid of this.

dorchard commented 9 months ago

Thanks for this! What is going on here is that you are getting the input-output message on your console and then you are also getting the return output of the program- we always show the output of the program s well. There isn't really a way of suppressing this if you are using gr but I can see how it would be useful not to see this! Do you want to turn this into a feature request?

rzuckerm commented 9 months ago

@dorchard Yes, please

dorchard commented 9 months ago

Maybe something like gr --no-return-value ?

rzuckerm commented 9 months ago

Yes, that would be good. Thanks!

rzuckerm commented 9 months ago

When #231 is merged, will there be a new release? I'd prefer to use a released version for this docker image that I use in the Sample Programs repo.

dorchard commented 5 months ago

Sorry forgot to say that this in release https://github.com/granule-project/granule/releases/tag/v0.9.5.0!