Skip to content

Instantly share code, notes, and snippets.

@retronym
Created August 7, 2012 06:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retronym/3282240 to your computer and use it in GitHub Desktop.
Save retronym/3282240 to your computer and use it in GitHub Desktop.
hash-set-reflect
scala> val cm = reflect.runtime.currentMirror
cm: reflect.runtime.universe.Mirror = JavaMirror with scala.tools.nsc.interpreter.IMain$TranslatingClassLoader@2635ee49 of type class scala.tools.nsc.interpreter.IMain$TranslatingClassLoader with classpath [(memory)] and parent being scala.tools.nsc.util.ScalaClassLoader$URLClassLoader@1eaf0e38 of type class scala.tools.nsc.util.ScalaClassLoader$URLClassLoader with classpath [file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/classes.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/ui.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/jsse.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Classes/jce.jar,file:/Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Class...
scala> val hs = cm.universe.typeOf[collection.immutable.HashSet[_]]
hs: cm.universe.Type = scala.collection.immutable.HashSet[_]
scala> println(hs.members.map(m => (m.owner.owner.name.decoded + "." + m.owner.name.decoded + "#" + m.name.decoded + m.typeSignature)).toSeq.mkString("\n"))
immutable.HashSet#writeReplace()AnyRef
immutable.HashSet#removed0(key: <?>, hash: <?>, level: <?>)scala.collection.immutable.HashSet[A]
immutable.HashSet#updated0(key: <?>, hash: <?>, level: <?>)scala.collection.immutable.HashSet[A]
immutable.HashSet#get0(key: <?>, hash: <?>, level: <?>)Boolean
immutable.HashSet#computeHash(key: <?>)Int
immutable.HashSet#improve(hcode: <?>)Int
immutable.HashSet#elemHashCode(key: <?>)Int
immutable.HashSet#-(e: A)scala.collection.immutable.HashSet[A]
immutable.HashSet#+(elem1: A, elem2: A, elems: A*)scala.collection.immutable.HashSet[A]
immutable.HashSet#+(e: A)scala.collection.immutable.HashSet[A]
immutable.HashSet#contains(e: A)Boolean
immutable.HashSet#foreach[U](f: A => U)Unit
immutable.HashSet#iterator=> Iterator[A]
immutable.HashSet#empty=> scala.collection.immutable.HashSet[A]
immutable.HashSet#size=> Int
immutable.HashSet#par=> scala.collection.parallel.immutable.ParHashSet[A]
immutable.HashSet#companion=> scala.collection.generic.GenericCompanion[scala.collection.immutable.HashSet]
immutable.HashSet#<init>()scala.collection.immutable.HashSet[A]
collection.CustomParallelizable#parCombiner=> scala.collection.parallel.Combiner[A,ParRepr]
collection.CustomParallelizable#$init$()Unit
immutable.Set#seq=> scala.collection.immutable.Set[A]
immutable.Set#toSet[B >: A]=> scala.collection.immutable.Set[B]
collection.SetLike#super$map[B <: <?>, That](f: <?>)(implicit bf: <?>)That
collection.SetLike#toString()String
collection.SetLike#stringPrefix=> String
collection.SetLike#SubsetsItrscala.collection.AbstractIterator[This] {
private[this] val elms: <?>
private[this] val len: <?>
def <init>: <?>
private val idxs: <?>
private[this] val idxs: <?>
private def _hasNext: <?>
private def _hasNext_=: <?>
private[this] var _hasNext: <?>
def hasNext: <?>
def next: <?>
}
collection.SetLike#subsets=> Iterator[This]
collection.SetLike#subsets(len: <?>)Iterator[This]
collection.SetLike#diff(that: scala.collection.GenSet[A])This
collection.SetLike#union(that: scala.collection.GenSet[A])This
collection.SetLike#isEmpty=> Boolean
collection.SetLike#++(elems: scala.collection.GenTraversableOnce[A])This
collection.SetLike#map[B, That](f: A => B)(implicit bf: scala.collection.generic.CanBuildFrom[This,B,That])That
collection.SetLike#toBuffer[A1 >: A]=> scala.collection.mutable.Buffer[A1]
collection.SetLike#toSeq=> Seq[A]
collection.SetLike#newBuilder=> scala.collection.mutable.Builder[A,This]
generic.Subtractable#--(xs: <?>)Repr
generic.Subtractable#-(elem1: A, elem2: A, elems: A*)Repr
collection.GenSetLike#hashCode()Int
collection.GenSetLike#equals(that: Any)Boolean
collection.GenSetLike#subsetOf(that: <?>)Boolean
collection.GenSetLike#&~(that: <?>)Repr
collection.GenSetLike#|(that: <?>)Repr
collection.GenSetLike#&(that: <?>)Repr
collection.GenSetLike#intersect(that: <?>)Repr
collection.GenSetLike#apply(elem: A)Boolean
scala.Function1#andThen[A](g: <?>)T1 => A
scala.Function1#compose[A](g: <?>)A => R
collection.IterableLike#view(from: Int, until: Int)scala.collection.IterableView[A,Repr]
collection.IterableLike#view=> scala.collection.IterableView[A,Repr]
collection.IterableLike#canEqual(that: Any)Boolean
collection.IterableLike#toStream=> scala.collection.immutable.Stream[A]
collection.IterableLike#sameElements[B >: A](that: scala.collection.GenIterable[B])Boolean
collection.IterableLike#zipWithIndex[A1 >: A, That](implicit bf: scala.collection.generic.CanBuildFrom[Repr,(A1, Int),That])That
collection.IterableLike#zipAll[B, A1 >: A, That](that: scala.collection.GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: scala.collection.generic.CanBuildFrom[Repr,(A1, B),That])That
collection.IterableLike#zip[A1 >: A, B, That](that: scala.collection.GenIterable[B])(implicit bf: scala.collection.generic.CanBuildFrom[Repr,(A1, B),That])That
collection.IterableLike#copyToArray[B >: A](xs: Array[B], start: Int, len: Int)Unit
collection.IterableLike#dropRight(n: <?>)Repr
collection.IterableLike#takeRight(n: <?>)Repr
collection.IterableLike#sliding(size: <?>, step: <?>)Iterator[Repr]
collection.IterableLike#sliding(size: <?>)Iterator[Repr]
collection.IterableLike#grouped(size: <?>)Iterator[Repr]
collection.IterableLike#takeWhile(p: A => Boolean)Repr
collection.IterableLike#drop(n: Int)Repr
collection.IterableLike#take(n: Int)Repr
collection.IterableLike#slice(from: Int, until: Int)Repr
collection.IterableLike#head=> A
collection.IterableLike#toIterator=> Iterator[A]
collection.IterableLike#toIterable=> Iterable[A]
collection.IterableLike#reduceRight[B >: A](op: (A, B) => B)B
collection.IterableLike#foldRight[B](z: B)(op: (A, B) => B)B
collection.IterableLike#find(p: A => Boolean)Option[A]
collection.IterableLike#exists(p: A => Boolean)Boolean
collection.IterableLike#forall(p: A => Boolean)Boolean
collection.IterableLike#toCollection(repr: Repr)Iterable[A]
collection.IterableLike#thisCollection=> Iterable[A]
generic.GenericTraversableTemplate#transpose[B](implicit asTraversable: <?>)CC[CC[B] @scala.annotation.unchecked.uncheckedVariance]
generic.GenericTraversableTemplate#flatten[B](implicit asTraversable: <?>)CC[B]
generic.GenericTraversableTemplate#unzip3[A1, A2, A3](implicit asTriple: <?>)(CC[A1], CC[A2], CC[A3])
generic.GenericTraversableTemplate#unzip[A1, A2](implicit asPair: <?>)(CC[A1], CC[A2])
generic.GenericTraversableTemplate#sequential=> scala.collection.TraversableOnce[A]
generic.GenericTraversableTemplate#genericBuilder[B]=> scala.collection.mutable.Builder[B,CC[B]]
collection.TraversableLike#iterateUntilEmpty(f: <?>)Iterator[Repr]
collection.TraversableLike#WithFilterAnyRef
with scala.collection.generic.FilterMonadic[A,Repr] {
private[this] val p: <?>
def <init>: <?>
def map: <?>
def flatMap: <?>
def foreach: <?>
def withFilter: <?>
}
collection.TraversableLike#withFilter(p: A => Boolean)scala.collection.generic.FilterMonadic[A,Repr]
collection.TraversableLike#to[Col[_]](implicit cbf: scala.collection.generic.CanBuildFrom[Nothing,A,Col[A @scala.annotation.unchecked.uncheckedVariance]])Col[A @scala.annotation.unchecked.uncheckedVariance]
collection.TraversableLike#toTraversable=> Traversable[A]
collection.TraversableLike#inits=> Iterator[Repr]
collection.TraversableLike#tails=> Iterator[Repr]
collection.TraversableLike#splitAt(n: Int)(Repr, Repr)
collection.TraversableLike#span(p: A => Boolean)(Repr, Repr)
collection.TraversableLike#dropWhile(p: A => Boolean)Repr
collection.TraversableLike#sliceWithKnownBound(from: <?>, until: <?>)Repr
collection.TraversableLike#sliceWithKnownDelta(from: <?>, until: <?>, delta: <?>)Repr
collection.TraversableLike#init=> Repr
collection.TraversableLike#lastOption=> Option[A]
collection.TraversableLike#last=> A
collection.TraversableLike#tail=> Repr
collection.TraversableLike#headOption=> Option[A]
collection.TraversableLike#scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#groupBy[K](f: A => K)scala.collection.immutable.Map[K,Repr]
collection.TraversableLike#partition(p: A => Boolean)(Repr, Repr)
collection.TraversableLike#collect[B, That](pf: PartialFunction[A,B])(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#filterNot(p: A => Boolean)Repr
collection.TraversableLike#filter(p: A => Boolean)Repr
collection.TraversableLike#flatMap[B, That](f: A => scala.collection.GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#++:[B <: <?>, That](that: <?>)(implicit bf: <?>)That
collection.TraversableLike#++:[B <: <?>, That](that: <?>)(implicit bf: <?>)That
collection.TraversableLike#++[B >: A, That](that: scala.collection.GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[Repr,B,That])That
collection.TraversableLike#hasDefiniteSize=> Boolean
collection.TraversableLike#isTraversableAgain=> Boolean
collection.TraversableLike#repr=> Repr
collection.TraversableLike#SelfRepr
collection.TraversableOnce#addString(b: <?>)StringBuilder
collection.TraversableOnce#addString(b: <?>, sep: <?>)StringBuilder
collection.TraversableOnce#addString(b: <?>, start: <?>, sep: <?>, end: <?>)StringBuilder
collection.TraversableOnce#mkString=> String
collection.TraversableOnce#mkString(sep: String)String
collection.TraversableOnce#mkString(start: String, sep: String, end: String)String
collection.TraversableOnce#toMap[T, U](implicit ev: <:<[A,(T, U)])scala.collection.immutable.Map[T,U]
collection.TraversableOnce#toVector=> Vector[A]
collection.TraversableOnce#toIndexedSeq=> scala.collection.immutable.IndexedSeq[A]
collection.TraversableOnce#toList=> List[A]
collection.TraversableOnce#toArray[B >: A](implicit evidence$1: scala.reflect.ClassTag[B])Array[B]
collection.TraversableOnce#copyToArray[B >: A](xs: Array[B])Unit
collection.TraversableOnce#copyToArray[B >: A](xs: Array[B], start: Int)Unit
collection.TraversableOnce#copyToBuffer[B <: <?>](dest: <?>)Unit
collection.TraversableOnce#minBy[B](f: A => B)(implicit cmp: Ordering[B])A
collection.TraversableOnce#maxBy[B](f: A => B)(implicit cmp: Ordering[B])A
collection.TraversableOnce#max[B >: A](implicit cmp: Ordering[B])A
collection.TraversableOnce#min[B >: A](implicit cmp: Ordering[B])A
collection.TraversableOnce#product[B >: A](implicit num: Numeric[B])B
collection.TraversableOnce#sum[B >: A](implicit num: Numeric[B])B
collection.TraversableOnce#aggregate[B](z: B)(seqop: (B, A) => B, combop: (B, B) => B)B
collection.TraversableOnce#fold[A1 >: A](z: A1)(op: (A1, A1) => A1)A1
collection.TraversableOnce#reduceOption[A1 >: A](op: (A1, A1) => A1)Option[A1]
collection.TraversableOnce#reduce[A1 >: A](op: (A1, A1) => A1)A1
collection.TraversableOnce#reduceRightOption[B >: A](op: (A, B) => B)Option[B]
collection.TraversableOnce#reduceLeftOption[B >: A](op: (B, A) => B)Option[B]
collection.TraversableOnce#reduceLeft[B >: A](op: <?>)B
collection.TraversableOnce#foldLeft[B](z: B)(op: (B, A) => B)B
collection.TraversableOnce#:\[B](z: B)(op: (A, B) => B)B
collection.TraversableOnce#/:[B](z: B)(op: (B, A) => B)B
collection.TraversableOnce#collectFirst[B](pf: <?>)Option[B]
collection.TraversableOnce#count(p: A => Boolean)Int
collection.TraversableOnce#nonEmpty=> Boolean
collection.TraversableOnce#reversed=> List[A]
collection.GenTraversableOnce#/:\[A1 >: A](z: <?>)(op: <?>)A1
lang.Object#$asInstanceOf[T0]()T0
lang.Object#$isInstanceOf[T0]()Boolean
lang.Object#synchronized[T0](x$1: T0)T0
lang.Object###()Int
lang.Object#!=(x$1: AnyRef)Boolean
lang.Object#==(x$1: AnyRef)Boolean
lang.Object#ne(x$1: AnyRef)Boolean
lang.Object#eq(x$1: AnyRef)Boolean
lang.Object#notifyAll()Unit
lang.Object#notify()Unit
lang.Object#clone()Object
lang.Object#getClass()Class[_]
lang.Object#wait(x$1: Long, x$2: Int)Unit
lang.Object#wait(x$1: Long)Unit
lang.Object#wait()Unit
lang.Object#finalize()Unit
scala.Any#asInstanceOf[T0]=> T0
scala.Any#isInstanceOf[T0]=> Boolean
scala.Any#!=(x$1: Any)Boolean
scala.Any#==(x$1: Any)Boolean
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment