Allow type signature in export list
In response to the new InstanceSigs extension in the 7.6.1 RC1, waterlight on Reddit suggested the following:
"While we're at it, why not also allow type signatures in export lists? People tend to add them anyway as comments, just because it's useful documentation. Checking for consistency would be nice."
The desired syntax, therefore, is something like this:
{-# LANGUAGE ExportSigs #-}
module Foo
( foo :: Bar -> Baz
, Blah ( Blip :: a -> Blah a
, Bloop :: Blah Int )
, Quux ( quux :: Quux q => a -> q a
, qux :: Quux q => q (q ()) )
) where
...
where all of the type annotations here are optional, and can be no less restrictive than the corresponding type signatures provided at the definition site, if provided (whether that be in that file's own code, or imported from another file).
This would have non-trivial interaction with -fno-warn-missing-signatures, and consequently, with #2526 (closed). There may also be non-trivial interaction with GADTs, if we allow exported constructors to be annotated with a type signature.
This idea was vaguely referenced by #1404 (closed), to which igloo responded:
"Type sigs in export lists might be nice, as some people seem to like giving them as comments which then get out of sync with the actual types."
If we are to consider this sort of thing for Haskell', we should try it out as a GHC extension first.