This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate nom; | |
use nom::{alphanumeric, digit}; | |
use std::str::FromStr; | |
use std::collections::{HashSet, HashMap, VecDeque}; | |
// do_parse! lets you chain parsers together and give the intermediates a name. | |
// expr_res! lets you turn Result-returning functions into fake parsers. | |
// we use this to (step by step) turn a string into a usize. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
set -e | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 ASSN-NUM" | |
echo "Fetches a copy of asst[ASSN-NUM] and puts it at" | |
echo "/home/\$USER/cs3231/asst[ASSN-NUM]-src". | |
echo "Deletes all traces of the unholy svn." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/asst0-src/kern/conf/conf.kern b/asst0-src/kern/conf/conf.kern | |
index d23e6bc..b18ae7f 100644 | |
--- a/asst0-src/kern/conf/conf.kern | |
+++ b/asst0-src/kern/conf/conf.kern | |
@@ -425,3 +425,12 @@ file test/synchtest.c | |
file test/malloctest.c | |
file test/fstest.c | |
optfile net test/nettest.c | |
+ | |
+####################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless._ | |
import shapeless.ops.coproduct.Length | |
import shapeless.ops.nat.ToInt | |
import scala.util.Random | |
import scalaz.Reader | |
sealed trait T | |
case class A(s: String) extends T | |
case class B(n: Int, t: T) extends T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless._ | |
import shapeless.test._ | |
sealed trait T | |
case class A(s1: String, t: T) extends T | |
case class B(s2: String) extends T | |
object Demo1 { | |
import DemoAux._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless._ | |
sealed trait V | |
case class S(value: String) extends V | |
case class N(value: Int) extends V | |
sealed trait L | |
case class Vs(values: Seq[V]) extends L | |
object NestedRecursion { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless._ | |
/* | |
* Created by EAPierzchalski on 7th August 2014 | |
*/ | |
//Generic[_] and TypeClass[_] are known to have issues with | |
//sealed case class families inside of objects, | |
//so we pre-empt that by moving them to the top level. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.pierzchalski.util | |
import scala.language.experimental.macros | |
import scala.reflect.macros.Context | |
import scala.collection.immutable | |
object Util { | |
def values[A]: immutable.Set[A] = macro valuesImpl[A] | |
def valuesImpl[A](c: Context)(implicit ev: c.WeakTypeTag[A]): c.Expr[immutable.Set[A]] = { |