sure 0.1.0

Numeric refinement types
docs.rs failed to build sure-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

sure

Numeric refinement types who's type automatically adjusts after operations.

Example

use sure::SetU8;

fn main() {
  // `foo` is known to be in the set {1, 2, 3} 
  let foo: SetU8![1, 2, 3] = SetU8::new(2).unwrap();

  // `bar` is known to be in the set {5, 6} 
  let bar: SetU8![5, 6] = SetU8::new(6).unwrap();

  // `baz` is known to be in the set {5, 10, 15, 6, 12, 18},
  // precisely because those are the only possible results 
  // from multiplying an element from `foo`'s set with one from `bar`'s set.
  let baz: SetU8![5, 6, 10, 12, 15, 18] = foo * bar;

  assert_eq!(baz.inner(), 12);
}