Student name: Kyle Headley
- Project kind: IC library implementation
- Project details: Extend the rust implementation of the RAZ with additional incremental features.
use std::fmt::Display; | |
trait Monadic {} | |
#[derive(Debug)] | |
struct Monad<M:Monadic,T>(M,T); | |
#[derive(Debug)] | |
struct Opt(bool); | |
impl Monadic for Opt {} | |
impl<T:Default> Monad<Opt,T> { |
#![allow(unused)] | |
use std::fmt::Debug; | |
#[derive(Debug)] | |
struct Door<S: DoorState> { | |
state: S, | |
} | |
trait DoorState {} |
trait F<V,X> {} | |
struct D; | |
trait TheV2 { | |
type IsThis; | |
} | |
impl<V1,V2> TheV2 for F<V1,V2> { | |
type IsThis = V2; |
// emulates the type of a function from types 'E' to sequence-like types | |
pub trait SeqTypeFn<E> { type Result : SeqLike<E>; } | |
// sequence-like interface | |
pub trait SeqLike<E>{ | |
fn new() -> Self; | |
fn push(self,e:E) -> Self; | |
fn first(&self) -> Option<&E>; | |
} |
#![allow(dead_code)] | |
struct True; | |
struct False; | |
impl IsEqual<False> for True {type Out=False;} | |
impl IsEqual<False> for False {type Out=True;} | |
impl IsEqual<True> for True {type Out=True;} | |
impl IsEqual<True> for False {type Out=False;} | |
trait Nat {fn inst()->usize;} | |
struct Zero; |
#![allow(unused)] | |
#![feature(non_ascii_idents)] | |
// #![feature(conservative_impl_trait)] | |
// basic nats, my knowledge | |
mod nat { | |
pub trait Nat { fn to_usize() -> usize; } | |
pub struct Zero; | |
impl Nat for Zero { fn to_usize() -> usize { 0 } } | |
pub struct Succ<N>(pub N); |
#![allow(unused)] | |
use std::error::Error; | |
use std::io::prelude::*; | |
use std::process::{Command, Stdio}; | |
use std::str; | |
fn main() { | |
let process = match Command::new("z3") | |
// use any z3 language with another .arg() here | |
.arg("-in") |
//! This file is a translation of the example code in the OCaml manual | |
//! chapter two,"The module system", into Rust code. | |
//! | |
//! The intent is to translate as directly as possible, to show OCaml | |
//! users a way to implement their functionality. This means that | |
//! later, more complex sections are neither idiomatic Rust nor a | |
//! perfect translation of the OCaml. Further study would be required, | |
//! but hopefully this helps explain some of the concepts. | |
//! | |
//! There are two constructs in Rust that might match OCaml modules, |
use std::thread; | |
use std::sync::Arc; | |
use std::sync::RwLock; | |
struct Wrap{one:usize,zero:usize} | |
trait WriteIt { | |
fn write1(&mut self,w:usize); | |
fn read1(&self) -> usize; | |
} |