On Wed, Feb 18, 2009 at 1:20 AM, Cristiano Paris <frodo@theshire.org> wrote:
2009/2/18 Luke Palmer <lrpalmer@gmail.com>:
> ...
> Using dependent types, you could have Prime come with a proof that theI'm curious to know whether a type system exists in which such a
> integer it contains is prime, and thus make those assumptions explicit and
> usable in the implementation. Unfortunately, it would be a major pain in
> the ass to do that in Haskell (for one, your algorithm would have to be
> implemented at the type level with annoying typeclasses to reify number
> types to real integers, and... yeah, people say Haskell has dependent types,
> but not in any reasonable way :-). Dependent languages like Agda, Coq, and
> Epigram are designed for this kind of thing.
constraint on the type of an argument can be expressed and enforced.
In such a case, does the compiler will ever terminate the
type-checking phase?