Skip to content

Instantly share code, notes, and snippets.

Kyle Headley kyleheadley

Block or report user

Report or block kyleheadley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kyleheadley /
Created Aug 1, 2017
Demonstrate searching a type-level list in rust
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;
kyleheadley /
Last active Jul 28, 2017
Show off type functions in rust with an example of 'type constructors'
// 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>;
kyleheadley /
Created Jul 10, 2017
Possible alternative for missing type equality in rust trait impl's
trait F<V,X> {}
struct D;
trait TheV2 {
type IsThis;
impl<V1,V2> TheV2 for F<V1,V2> {
type IsThis = V2;
use std::fmt::Debug;
struct Door<S: DoorState> {
state: S,
trait DoorState {}
kyleheadley /
Last active Mar 20, 2017
CSCI 7000 Spring '17 -- Course Project Proposal

CSCI 7000 -- Course Project Proposal

Student name: Kyle Headley

Project Description:

  • Project kind: IC library implementation
  • Project details: Extend the rust implementation of the RAZ with additional incremental features.
kyleheadley /
Last active Feb 8, 2017
Prototype implementation of Monads in Rust
use std::fmt::Display;
trait Monadic {}
struct Monad<M:Monadic,T>(M,T);
struct Opt(bool);
impl Monadic for Opt {}
impl<T:Default> Monad<Opt,T> {
You can’t perform that action at this time.