Module aya.base

Record Class Expr.Array.CompBlock

java.lang.Object
java.lang.Record
org.aya.concrete.Expr.Array.CompBlock
Record Components:
generator - x * y part above
binds - x invalid input: '<'- [1, 2, 3], y invalid input: '<'- [4, 5, 6] part above
bindName - the bind (>>=) function, it is Constants.monadBind in default
pureName - the pure (return) function, it is Constants.functorPure in default
Enclosing class:
Expr.Array

public static record Expr.Array.CompBlock(@NotNull Expr generator, @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull Expr bindName, @NotNull Expr pureName) extends Record

Array Comp(?)

The (half?) primary part of Expr.Array
For example: [x * y | x invalid input: '<'- [1, 2, 3], y invalid input: '<'- [4, 5, 6]]

API Note:
a ArrayCompBlock will be desugar to a do-block. For the example above, it will be desugared to
     do
       x invalid input: '<'- [1, 2, 3]
       y invalid input: '<'- [4, 5, 6]
       return x * y
   
  • Constructor Details

    • CompBlock

      public CompBlock(@NotNull @NotNull Expr generator, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull @NotNull Expr bindName, @NotNull @NotNull Expr pureName)
      Creates an instance of a CompBlock record class.
      Parameters:
      generator - the value for the generator record component
      binds - the value for the binds record component
      bindName - the value for the bindName record component
      pureName - the value for the pureName record component
  • Method Details

    • update

      @NotNull public @NotNull Expr.Array.CompBlock update(@NotNull @NotNull Expr generator, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull @NotNull Expr bindName, @NotNull @NotNull Expr pureName)
    • descent

      @NotNull public @NotNull Expr.Array.CompBlock descent(@NotNull @NotNull UnaryOperator<@NotNull Expr> f)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • generator

      @NotNull public @NotNull Expr generator()
      Returns the value of the generator record component.
      Returns:
      the value of the generator record component
    • binds

      @NotNull public @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds()
      Returns the value of the binds record component.
      Returns:
      the value of the binds record component
    • bindName

      @NotNull public @NotNull Expr bindName()
      Returns the value of the bindName record component.
      Returns:
      the value of the bindName record component
    • pureName

      @NotNull public @NotNull Expr pureName()
      Returns the value of the pureName record component.
      Returns:
      the value of the pureName record component