fun 0.0.1

A small prelude for functional programming in Rust
/// The empty type; no values exist or can be constructed;
#[derive(Clone)]
#[derive(Copy)]
#[derive(Eq)]
#[derive(Hash)]
#[derive(Ord)]
#[derive(PartialEq)]
#[derive(PartialOrd)]
#[derive(Show)]
pub enum Void {}

#[inline]
pub fn elim<R>(_: Void) -> R {
    unsafe { ::std::intrinsics::unreachable() }
}

impl Void {
    /// Because Void has no inhabitants, it's safe to say that
    /// eliminating it would yield any type we choose.
    #[inline]
    pub fn elim<R>(self) -> R { elim(self) }
}