logoalt Hacker News

robertlagranttoday at 7:29 PM1 replyview on HN

What we need is a numeric type that cannot be zero.


Replies

drdaemantoday at 7:39 PM

What we need are refinement types, where there’s a base type and a predicate. F* has this:

     val (/) : int -> (divisor:int { divisor <> 0 }) -> int