Pro

trait Pro[+A]

Value Provider

Whenever value provider belongs to an object, it effectively becomes a property holder for this object.

Properties Framework

There are 4 types of standard properties:

The inheritance graph looks like:

       Pro.O
      /      \
   Pro        Pro.OM
      \     /
       Pro.M

By Scalqa convention, method names, which return Pro type, are ended with '_*' instead of word 'Property'

Here is an example of 'name' property definition hierarchy:

        trait Foo:                                   // 'name' is read only
          def name_*          : Pro[String]
          def name            : String = name_*()    // required shortcut

        trait Foo_M extends Foo:                     // 'name' is read/write
          def name_*          : Pro.M[String]
          def name_=(v:String): Unit = name_*() = v  // required shortcut

        trait Foo_O extends Foo:                     // 'name' is read/listenTo
          def name_*          : Pro.O[String]

        trait Foo_OM extends Foo_O with Foo_M:       // 'name' is read/write/listenTo
          def name_*          : Pro.OM[String]

Note. The 'required shortcuts' must be implemented. They will not even show up in documentation, because they are assumed to be there

Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any

Def

def apply(): A

Get value

Get value

Returns property value

   val pro: Pro.M[String] = Pro.M[String]("abc")

   val v1 = pro.apply() // Regular call
   val v2 = pro()       // Scala "syntactic sugar" call
Source
__.scala

Extension

inline def contains[A](inline v: A): Boolean
Source
__.scala
@scala.annotation.targetName("map_View")
def map_^[A](f: A => B): Pro[B]
Source
__.scala
@scala.annotation.targetName("observable_View")
Source
__.scala