Hano is a project mainly written in Scala, it's free.
Reactive Sequence Combinators in Scala
hano
is a reactive sequence combinator library:
val mouse = hano.Swing.Mouse(jl)
mouse.Pressed.onEach { p =>
println("pressed at: " + (p.getX, p.getY))
mouse.Dragged.stepFor {
100
} takeUntil {
mouse.Released
} onEach { d =>
println("dragging at: " + (d.getX, d.getY))
} onExit { _ =>
println("released")
} start
} start
If you are familliar with Reactive Extensions, see Hano vs Rx Method Table.
hano.Seq
is essentially built upon the famous method foreach
:
package hano
trait Seq[+A] {
def foreach(f: A => Unit): Unit
// map, filter etc
}
Unlike scala.collection.Traversable
, this foreach
is allowed to be asynchronous.
Append this in your project definition:
val hano = "com.github.okomok" % "hano_2.9.0" % "0.1.0"
val okomokReleases = "okomok releases" at "http://okomok.github.com/maven-repo/releases"
Shunsuke Sogame <[email protected]>