decrel

package decrel

Welcome to the source code/javadoc of decrel, library for declarative programming with relations.

decrel is built on the idea to allow clear expression of relations that are implied in your domain models.

Traditionally, one way such relations are frequently expressed are in the form of SQL foreign key constraints. Other places may also include documentation living outside of the codebase as diagrams.

All of these expressions of relations are not easily usable directly in the code. Therefore, it is the programmers' job to understand these relations and translate them into imperative steps in order to express a desirable outcome.

The goal of this library is to allow expressing underused implicit knowledge as an explicit first-class value, and achieve better expressiveness in other parts of the code as a result.

Attributes

Members list

Concise view

Type members

Classlikes

sealed trait Relation[-In, +Out]

A declaration of a Relation object by extending one of Relation.Single, Relation.Optional or Relation.Many can be thought of as an edge in the directed graph that is your entire domain model.

A declaration of a Relation object by extending one of Relation.Single, Relation.Optional or Relation.Many can be thought of as an edge in the directed graph that is your entire domain model.

An expression with a type of Relation[A, B] represents a traversal of the domain model graph starting from A into B, where B can be a result of accumulation of an arbitrary number of nodes.

Attributes

In

When declaring: starting node of an edge. When in an expression: starting node of a traversal

Out

When declaring: ending node of an edge. When in an expression: accumulated nodes of a traversal

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Composed[LeftTree, LeftIn, LeftOut, RightTree, RightIn, RightOut, Out]
class Many[LeftTree, LeftIn, LeftOut, RightTree, RightIn, RightOut, CC]
class Optional[LeftTree, LeftIn, LeftOut, RightTree, RightIn, RightOut]
class Single[LeftTree, LeftIn, LeftOut, RightTree, RightIn, RightOut]
class Zipped[LeftTree, LeftIn, LeftOut, RightTree, RightIn, RightOut, ZippedOut]
class Custom[Tree, In, Out]
trait Declared[In, Out]
trait Many[In, Collection, Out]
trait Optional[In, Out]
trait Single[In, Out]
trait Self[A]
object Relation

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait Zippable[-A, -B]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Zippable.type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait syntax

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object syntax.type
object syntax extends syntax

Attributes

Companion:
trait
Graph
Supertypes
trait syntax
class Object
trait Matchable
class Any
Self type
syntax.type

Inherited classlikes

final implicit class CustomSyntax[Tree, In, Out](self: Tree & Relation[In, Out])

Attributes

Inherited from:
syntax
Graph
Supertypes
class Object
trait Matchable
class Any
final implicit class RelationComposeSyntax[RightTree, RightIn, RightOut](right: RightTree & Relation[RightIn, RightOut])

Attributes

Inherited from:
syntax
Graph
Supertypes
class Object
trait Matchable
class Any
final implicit class ZipSyntax[LeftTree, LeftIn, LeftOut](self: LeftTree & Relation[LeftIn, LeftOut])

Attributes

Inherited from:
syntax
Graph
Supertypes
class Object
trait Matchable
class Any

Implicits

Inherited implicits

final implicit def CustomSyntax[Tree, In, Out](self: Tree & Relation[In, Out]): CustomSyntax[Tree, In, Out]

Attributes

Inherited from:
syntax
final implicit def RelationComposeSyntax[RightTree, RightIn, RightOut](right: RightTree & Relation[RightIn, RightOut]): RelationComposeSyntax[RightTree, RightIn, RightOut]

Attributes

Inherited from:
syntax
final implicit def ZipSyntax[LeftTree, LeftIn, LeftOut](self: LeftTree & Relation[LeftIn, LeftOut]): ZipSyntax[LeftTree, LeftIn, LeftOut]

Attributes

Inherited from:
syntax