LeafSyntax

class LeafSyntax[V](value: V)

Syntax for lifting values into DescribedComputations and creating leaf nodes in the log tree.

Syntax for lifting values into DescribedComputations and creating leaf nodes in the log tree.

class Object
trait Matchable
class Any

Value members

Concrete methods

def logFailure(description: String): DescribedComputation[V]

Create a ''failure'' treelog.LogTreeSyntax.DescribedComputation with -\/(description) as the value and a failure treelog.LogTreeSyntax.DescribedComputation with the given description.

Create a ''failure'' treelog.LogTreeSyntax.DescribedComputation with -\/(description) as the value and a failure treelog.LogTreeSyntax.DescribedComputation with the given description.

import treelog.LogTreeSyntaxWithoutAnnotations._
import scalaz.syntax.show._

val leaf = 1 ~>! "One"
println(result.run.value)
// Will print: -\/("One") - note that the 'left' means ''failure'', and the contained value is the description, not the 1.

println(result.run.written.shows)
// Will print:
// Failed: One
def logFailure(description: V => String): DescribedComputation[V]

Create a ''failure'' treelog.LogTreeSyntax.DescribedComputation using the given description function to generate a description for the tree node's label and for the DescribedComputations value (i.e. the value will be \/-(description(value)).

Create a ''failure'' treelog.LogTreeSyntax.DescribedComputation using the given description function to generate a description for the tree node's label and for the DescribedComputations value (i.e. the value will be \/-(description(value)).

import treelog.LogTreeSyntaxWithoutAnnotations._
import scalaz.syntax.show._

val leaf = 1 logFailure (x => s"One - $x")
println(result.run.value)
// Will print: -\/("One") - note that the 'left' means ''failure'', and the contained value is the description, not the 1.

println(result.run.written.shows)
// Will print:
// Failed: One - 1
def logSuccess(description: String): DescribedComputation[V]

Create a ''success'' treelog.LogTreeSyntax.DescribedComputation with \/-(value) as the value and a success TreeNode with the given description.

Create a ''success'' treelog.LogTreeSyntax.DescribedComputation with \/-(value) as the value and a success TreeNode with the given description.

import treelog.LogTreeSyntaxWithoutAnnotations._
import scalaz.syntax.show._

val leaf = 1 logSuccess "One"
println(result.run.value)
// Will print: \/-(1) - note that the 'right' means ''success''

println(result.run.written.shows)
// Will print:
// One
def logSuccess(description: V => String): DescribedComputation[V]

Create a ''success'' treelog.LogTreeSyntax.DescribedComputation with \/-(value) as the value and a success treelog.LogTreeSyntax.DescribedComputation using the given description function to generate a description for the tree node's label.

Create a ''success'' treelog.LogTreeSyntax.DescribedComputation with \/-(value) as the value and a success treelog.LogTreeSyntax.DescribedComputation using the given description function to generate a description for the tree node's label.

import treelog.LogTreeSyntaxWithoutAnnotations._
import scalaz.syntax.show._

val leaf = 1 logSuccess (x => s"One: $x")
println(result.run.value)
// Will print: \/-(1) - note that the 'right' means ''success''

println(result.run.written.shows)
// Will print:
// One: 1
def ~>(description: String): DescribedComputation[V]

Sugar for logSuccess

Sugar for logSuccess

def ~>(description: V => String): DescribedComputation[V]
def ~>!(description: String): DescribedComputation[V]

Sugar for logFailure

Sugar for logFailure

def ~>!(description: V => String): DescribedComputation[V]