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
response -- Value
|> decodeAndParsePage -- Page
|> Page.star lineNumber -- Page
|> SavePage (Star lineNumber) -- Model
|> attachCmd -- (Model, Cmd Msg)
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?