io.github.srs.model.entity.dynamicentity.robot.behavior.dsl
Members list
Type members
Classlikes
object BehaviorDsl
Minimal DSL to build decision logic:
Behavior DSL (pure)
Minimal DSL to build decision logic:
- BehaviorTypes.PartialBehavior =
Kleisli[Option, I, A]– a partial decision (“may produce”). - BehaviorTypes.Behavior =
Kleisli[Id, I, A]– a total decision (“always produces”).
Partial behaviors compose left-biased (the first Some wins) and are finalized into total behaviors via orElse (or the compatibility alias default).
Attributes
- Example
-
val isEven: Condition[Int] = _ % 2 == 0 val rule: PartialBehavior[Int, String] = (isEven ==> "even") | (_ => true) ==> "odd" val behavior: Behavior[Int, String] = rule.orElse("n/a") behavior.run(2) // "even" behavior.run(3) // "odd" - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BehaviorDsl.type
In this article