Binding

semagrams.Binding
See theBinding companion object
case class Binding[A](selector: PartialFunction[Event, IO[A]], predicate: Option[BindingPredicate], docs: String)

A Binding associates an IO returning A action to events.

Attributes

A

The type that the binding eventually returns

docs

A description of the behavior of the binding, to be shown in a help screen.

modifiers

If present, the event only matches if these KeyModifiers are down.

selector

The function which says if an event "matches", and if so, what to do with it.

Todo:

selector should be concrete data that implements a trait, and part of that trait is a description of the binding, like "Ctrl-click on a box" or "press a".

actually use docs

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def andThen[B](mb: IO[B]): Binding[B]

Always do mb after a match.

Always do mb after a match.

Attributes

def fail(err: Error): Binding[Unit]

Raise an error after a match.

Raise an error after a match.

Attributes

def flatMap[B](g: A => IO[B]): Binding[B]

Add another action to do after a match, using the result of the match.

Add another action to do after a match, using the result of the match.

Attributes

def map[B](g: A => B): Binding[B]

Transform the result of the binding with g after a match.

Transform the result of the binding with g after a match.

Attributes

def mapTo[B](b: B): Binding[B]

Always return b after a match.

Always return b after a match.

Attributes

def withAltMods(newAltModifiers: Set[KeyModifier]*): Binding[A]

Only match when one of newAltModifiers are set.

Only match when one of newAltModifiers are set.

Attributes

def withMods(newModifiers: KeyModifier*): Binding[A]

Only match when newModifiers are set.

Only match when newModifiers are set.

Attributes

def withPredicate(newPredicate: BindingPredicate): Binding[A]

Only match when a given predicate is satisfied.

Only match when a given predicate is satisfied.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product