effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Effects should not be displayed when empty

Open b-studios opened this issue 1 year ago • 1 comments

When hovering over a function its full return type and effects are shown.

image

This is in contrast to our usual presentation where we would omit the empty set of effects and just say show returns a String (but not String / {}).

The code that renders function declarations is here:

https://github.com/effekt-lang/effekt/blob/80467d8d942ccd49fb2165261f90ae26b0b7cf0f/effekt/shared/src/main/scala/effekt/symbols/DeclPrinter.scala#L86-L89

and should be adapted to print effects similar to the TypePrinter:

https://github.com/effekt-lang/effekt/blob/80467d8d942ccd49fb2165261f90ae26b0b7cf0f/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala#L76

Optional: Maybe some logic between TypePrinter and DeclPrinter can be deduplicated

b-studios avatar Sep 25 '24 09:09 b-studios

I sort of like this though as it's explicit about the effects a function has. But I'm fine with removing it.

jiribenes avatar Sep 25 '24 09:09 jiribenes

Counter proposal: Not mentioning effects means: "please infer effects".

b-studios avatar Oct 02 '25 08:10 b-studios