[Haskell-cafe] type families and type signatures
claus.reinke at talk21.com
Wed Apr 9 05:54:52 EDT 2008
> The point is that the GHC type checker relies on automatic inference.
> Hence, there'll
> always be cases where certain "reasonable" type signatures are rejected.
> To conclude, any system with automatic inference will necessary reject
> certain type signatures/instances
> in order to guarantee soundness, completeness and termination.
i think Lennart's complaint is mainly about cases where GHC
does not accept the very type signature it infers itself. all of
which cases i'd consider bugs myself, independent of what
type system feature they are related to.
there are also the related cases of type signatures which
cannot be expressed in the language but which might
occur behind the scenes. all of these cases i'd consider
language limitations that ought to be removed.
the latter cases also mean that type errors are reported
either in a syntax that can not be used in programs or in
a misleading external syntax that does not fully represent
the internal type.
in this example, ghci infers a type for foo' that it rejects
as a type signature for foo'. so, either the inferred type
is inaccurately presented, or there's a gap in the type
system, between inferred and declared types, right?
More information about the Haskell-Cafe