scala - How can I 'discover' type classes/implicit values in the current scope? -
i've made use of few of scala's built-in type classes, , created few of own. however, biggest issue have them @ moment is: how find type classes available me? while of write small , simple, nice know if exists i'm implement!
so, there list, somewhere, of type classes or implicit values available in standard library? better, possible somehow (probably within repl) generate list of implicit values available in current scope?
it's job ide.
intellijidea 14+
check out implicits analyser in scala plugin 1.4.x. example usage:
def mymethod(implicit a: int) = { } implicit val a: int = 1 mymethod // click mymethod , press ctrl+shift+p, "implicit parameters" shown
eclipse
check out implicit highlighting.
scala repl
you can list implicits this:
:implicits -v
and investigate origin defined here:
import reflect.runtime.universe val tree = universe.reify(1 4).tree universe.showraw(tree) universe.show(tree)
Comments
Post a Comment