
Thanks for the additional responses. For the record, in response to
On Tue, Nov 24, 2020 at 3:51 PM Henning Thielemann
An alternative would be to let g be polymorphic but add 'a' as parameter:
f a bs = g a bs where g :: a -> [b] -> [(a, b)] g = map ((,) a)
this is what I had been doing before -- adding variables that were in scope as additional arguments to recursive helper functions, even though they don't change during recursive calls -- just so that I could give type annotations to helper functions for the purposes of documentation, since I didn't see any other way. (Of course, my helper function here is a simple application of `map`, but I was choosing this minimal example to illustrate something that came up repeatedly in more complicated situations.) The use of `ScopedTypeVariables`, though, is a better solution for me, since it allows me to continue my annotation practice without having to change the code I would ordinarily write. FWIW, my audience is college students using Haskell to supplement non-PL classes, and the annotations, perhaps more than usual, help them understand the code. Since I've already discussed polymorphism and type variables by that point, the explicit `forall`s (and language pragmas) are a satisfyingly minimal and easily explainable intrusion. Todd Wilson