I study Idris and as a personal exercise, I would like to implement a type Primesconsisting of all prime numbers.
Is there an idris way to define a new type, starting with a type and a property that will select all elements of the original type for which the property is true? In my case, is there a way to determine Primeshow a set is Natsuch that n <= p and n|p => n=1 or n=p?
If this is not possible, should primes be constructed inductively using a sieve?
source
share