On many occasions, whenever I’m trying to debug a pipeline that refuses to cooperate in some manner, I find myself writing the return signatures as side comments to get the feel for it, as below
This makes it easier for me to see what’s going on and how I can improve it.
Then I noticed the excellent GitLens tool that silently sits there and gives me context whenever I need it. (For those who don’t know, it shows git commit data for the line your cursor is in)
This got me thinking. What if there was this type introspection tool that showed the return type of each line as you went over it? Do you think it would be helpful?
That feature exists in the language server for rust so it should be doable with type inference in the elm language server. Here is an extract of the code that detects tests in elm-test-rs. You can see type annotated in blue right next to each pipe (successive method call but that’s the same).