[Haskell-cafe] Type-level naturals & multiplication

Brad Larsen brad.larsen at gmail.com
Tue Oct 13 11:40:53 EDT 2009

On Tue, Oct 13, 2009 at 3:37 AM, Simon Peyton-Jones
<simonpj at microsoft.com> wrote:
> It's also worth noting that while "undecidable" instances sound scary, but all it means is that the type checker can't prove that type inference will terminate.  We accept this lack-of-guarantee for the programs we *run*, and type inference can (worst case) take exponential time which is not so different from failing to terminate; so risking non-termination in type inference is arguably not so bad.
> Simon


On a related note, template instantiation in C++ is undecidable.  See
``C++ Templates are Turing Complete'' by Todd Veldhuizen:
And similarly, heavy use of templates in C++ can be *extremely*


More information about the Haskell-Cafe mailing list