Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created August 14, 2013 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/6227847 to your computer and use it in GitHub Desktop.
Save joshcough/6227847 to your computer and use it in GitHub Desktop.
implicit def shrinkCore[V](implicit s1: Shrink[V]): Shrink[Core[V]] = Shrink { c =>
c match {
case Var(_) => Stream.empty
case h: HardCore => Stream.empty
case App(f, x) => Stream(f, x)
// case class Let[+V](bindings: List[Scope[Byte, Core, V]], body: Scope[Byte, Core, V])
case Let(bindings, body) => Stream() // TODO: bindings, body
// case class Case[+V](c: Core[V], branches: Map[Byte, (Byte, Scope[Byte, Core, V])], default: Option[Scope[Unit, Core, V]])
case Case(c, branches, d) => Stream(c) // TODO: branches, default
case Data(tag, fields) => fields.toStream
// case class LamDict[+V](body: Scope[Unit, Core, V])
case LamDict(body) => Stream() // TODO: body
case AppDict(f, d) => Stream(f, d)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment