Haskell library docs and IDE-like website features
As a perennial almost-fluent Haskell reader, I still find
a couple of things making Haskell code harder to read than
it should have to be.
One of them is operator precedence, though I think I mostly
have a handle on it. As I commented (on JJ's
critique of Haskell syntax):
I do think that operator precedence in Haskell is one of the harder things
to get used to for beginners. Here's a feature I'd like to see in a Haskell
IDE: visually parenthesize code (upon request, or by default for novices)
by putting the background of the innermost parts in one shade, and holding
the next outer parts together with a slightly lighter shade, fading out to
match the background color at the outermost level. Do this in particular
with the unfamiliar operators -- the ones that do not exist in the more
popular languages.
I think you could do this with CSS in an HTML page that
contains Haskell source code.
And along similar lines:
Cale Gibbard wrote an excellent wiki entry about
How To Use Monad Transformers. What I found hardest to
follow was the times when he would use a library function with
which I was (actually, still am) unfamiliar.
In this case, none of lift
, liftIO
,
the =<<
operator, nor tell
were explained (though tell
looks clear
from the context, but I remain uneasy about it after looking at
its type).
I think it would be cool if instructive Haskell pages had
pop-up (aka "tooltip") links attached to most usages of
library functions, so that if you hover over the name,
you'd get a pop-up showing the function's type and a
brief description in English of what it does.
These website feature ideas are probably old-hat to you folks
who actually use IDEs, but it seems like a strange omission for
stuff on the web whose purpose is instruction.
Unfortunately, looking at some of
the Haskell library docs, it does appear that most of
those "brief description in English" texts are not actually
written yet.
11:51:12 PM