Idea: make assert!() a keyword - REJECTED

Regarding dependent types, I am not sure about the current RFC state, but why not just have something like this:

type Ordf32 = f32 where |x: f32| !x.is_nan();

Meaning you can just apply predicates to values of a type and create a new type like that. If the predicates are const functions, the compiler can type check them at compile time, otherwise it could be checked at run-time.

6 Likes