#equality #type-level #unification

unify

Trait-based equality constraint for Rust

4 releases

Uses old Rust 2015

0.0.3 Feb 23, 2015
0.0.2 Feb 23, 2015
0.0.1 Jan 10, 2015
0.0.0 Jan 9, 2015

#2420 in Rust patterns

MIT license

6KB
73 lines

unify.rs

Trait-based type-level equality constraint for Rust

build status

Synopsis

This crate provides a trait-based implementation of equality constraints. It is intended as a stopgap until proper equality predicates are implemented as described in the where-clause RFC.

Because it is a hack, there are some limitations with how it can be used. It is most effective as a helper for encoding additional trait invariants in order to rule out invalid implementations. Previously it was useful as a means to specify Self for static method invocation but this is no longer needed with UFCS.

Documentation

See the API documentation here.

Requirements

  1. Rust
  2. Cargo

You can install both with the following:

$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh

See Installing Rust for further details.

Usage

$ cargo build       ## build library and binary
$ cargo test        ## run tests in ./tests
$ cargo bench       ## run benchmarks in ./benches

Discussion

There is an IRC channel on freenode (chat.freenode.net) at #epsilonz.

No runtime deps