• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Scala-Robotics-Simulator / PPS-22-srs / #583

04 Sep 2025 08:29PM UTC coverage: 80.49% (+25.3%) from 55.207%
#583

push

github

GiuliaNardicchia
refactor: simplify comments in BehaviorTypes

1576 of 1958 relevant lines covered (80.49%)

11.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/scala/io/github/srs/model/entity/dynamicentity/behavior/BehaviorTypes.scala
1
package io.github.srs.model.entity.dynamicentity.behavior
2

3
import cats.Id
4
import cats.data.Kleisli
5
import io.github.srs.model.entity.dynamicentity.*
6

7
/**
8
 * Core types for Behavior
9
 *
10
 *   - [[Behavior]] total, pure decision (`I => A` via `Kleisli[Id, I, A]`)
11
 *   - [[PartialBehavior]] partial decision (`I => Option[A]` via `Kleisli[Option, I, A]`)
12
 *   - [[Condition]] boolean predicate on the input
13
 */
14
object BehaviorTypes:
15

×
16
  /**
17
   * Total, pure decision (Reader specialized to `Id`).
18
   *
19
   * @param I
20
   *   input type
21
   * @param A
22
   *   output type
23
   */
24
  type Behavior[I, A] = Kleisli[Id, I, A]
25

26
  /**
27
   * Partial decision: returns `Some(a)` if it fires, otherwise `None`.
28
   *
29
   * @param I
30
   *   input type
31
   * @param A
32
   *   output type
33
   */
34
  type PartialBehavior[I, A] = Kleisli[Option, I, A]
35

36
  /**
37
   * Boolean predicate on the input.
38
   *
39
   * @param I
40
   *   input type
41
   */
42
  type Condition[I] = I => Boolean
43

44
  /**
45
   * Constant predicate that always evaluates to `true`.
46
   *
47
   * @return
48
   *   a condition that ignores its input and returns `true`
49
   */
50
  val always: Condition[Any] = _ => true
51
end BehaviorTypes
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc