typed-sf 2.0.0

Typed ready-to-use implementation of SmallF*ck language in Rust.
Documentation
  • Coverage
  • 100%
    34 out of 34 items documented1 out of 1 items with examples
  • Size
  • Source code size: 21.03 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • uwuzote/typed-sf.rs
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • uwuzote

Simple, ready-to-use typed realization of SmallF*ck esoteric language. Highly inspired by this article.

use typed_sf::*;
type SetTrue<Next = EOF> = Cycle<Flip, Flip<Next>>;
// [*<<[*]*>>>] // Move any-sized chunk of True's 2 cells left

#[allow(non_camel_case_types)]
type prog = Cycle<Flip<Left<Left<SetTrue<Right<Right<Right>>>>>>>;

#[allow(non_camel_case_types)]
type result = Run<
    prog,
    State<Nil, True, Cons<True, Nil>>
>;

assert_eq!(
    <result as StateTrait>::val(),
    (vec![true, true, false, false], false, Vec::new())
);

Links:

Github repo: https://github.com/Zote-the-Mighty-4o2/typed-sf.rs
Documentation: https://docs.rs/typed-sf/