graydon/rust — pull request #1202 by boggle (2011-11-21 00:29:31+00:00)
Title: stdlib: added (2,3,4)-valued logic ADTs

This is useful for writing caches and perhaps in typestate predicates.

It also adds a companion module for bool with from_str, to_str, ... fns, similar to what is available for the unsigned integer types.

All modules have the same interface. I implemented the (3,4)-valued logics with bitops for performance.