Skip to content
Snippets Groups Projects
Commit 6538c20a authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Use proper API

parent 5b8f8e37
No related branches found
No related tags found
No related merge requests found
...@@ -8,17 +8,17 @@ import purescala.Types._ ...@@ -8,17 +8,17 @@ import purescala.Types._
import purescala.DefOps._ import purescala.DefOps._
case class Library(pgm: Program) { case class Library(pgm: Program) {
lazy val List = lookup("leon.collection.List").collect{ case acd : AbstractClassDef => acd }.headOption lazy val List = lookup("leon.collection.List").collectFirst { case acd : AbstractClassDef => acd }
lazy val Cons = lookup("leon.collection.Cons").collect { case ccd : CaseClassDef => ccd }.headOption lazy val Cons = lookup("leon.collection.Cons").collectFirst { case ccd : CaseClassDef => ccd }
lazy val Nil = lookup("leon.collection.Nil").collect { case ccd : CaseClassDef => ccd }.headOption lazy val Nil = lookup("leon.collection.Nil").collectFirst { case ccd : CaseClassDef => ccd }
lazy val Option = lookup("leon.lang.Option").collect { case acd : AbstractClassDef => acd }.headOption lazy val Option = lookup("leon.lang.Option").collectFirst { case acd : AbstractClassDef => acd }
lazy val Some = lookup("leon.lang.Some").collect { case ccd : CaseClassDef => ccd }.headOption lazy val Some = lookup("leon.lang.Some").collectFirst { case ccd : CaseClassDef => ccd }
lazy val None = lookup("leon.lang.None").collect { case ccd : CaseClassDef => ccd }.headOption lazy val None = lookup("leon.lang.None").collectFirst { case ccd : CaseClassDef => ccd }
lazy val String = lookup("leon.lang.string.String").collect { case ccd : CaseClassDef => ccd }.headOption lazy val String = lookup("leon.lang.string.String").collectFirst { case ccd : CaseClassDef => ccd }
lazy val setToList = lookup("leon.collection.setToList").collect { case fd : FunDef => fd }.headOption lazy val setToList = lookup("leon.collection.setToList").collectFirst { case fd : FunDef => fd }
def lookup(name: String): Seq[Definition] = { def lookup(name: String): Seq[Definition] = {
pgm.lookupAll(name) pgm.lookupAll(name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment