Re:Curry-Howard, the Ontological Ultimate
by kestert on Wednesday October 15, 2014 @07:34PM
(#8462458)
The constructive nature of Idris makes it hard (at least for me) to express a prime under 1,000,000 as a type. For example, it's trivial to express a composite as a GADT:
but there is no analogous construction of a prime type. Luckily most day to day programming looks more like the composite case than the prime case.
[ Parent
| on HN ]
Re:Curry-Howard, the Ontological Ultimate
by gergoerdi on Sunday October 19, 2014 @09:33PM
(#8480339)
As an example, here's how primality is defined in the Agda standard library. It is simply the negation of the property 'has a divisor and is greater than 2'.
http://agda.github.io/agda-stdlib/html/Data.Nat.Primality.ht...