Skip to content

Instantly share code, notes, and snippets.

View tyler569's full-sized avatar

Tyler Philbrick tyler569

  • San Francisco, USA
View GitHub Profile
class Color(prefix: String) {
def apply(text: String): String = {
prefix + text
}
}
object Color {
val RED = new Color("&c")
val BLUE = new Color("&1")
getAppend :: String -> IO String
getAppend x = getLine >>= return . (++ x)
main :: IO ()
main = getAppend " World!" >>= putStrLn
struct Foo<'a> {
a: String,
b: &'a str,
}
impl<'a> Foo<'a> {
fn new() -> Foo<'a> {
Foo { a: String::new(), b: "" }
}
#![feature(io)]
use std::net::{TcpStream};
use std::io::{BufRead, BufReader, Write, stdout};
//mod parser;
fn main() {
let name = "irc.freenode.net:6667";