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 <- [1, 2, 3], y <- [4, 5, 6] part above
names - the bind (>>=) function, it is Constants.monadBind(org.aya.util.error.SourcePos) in default, the pure (return) function, it is Constants.functorPure(org.aya.util.error.SourcePos) 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.Array.ListCompNames names) extends Record

Array Comp(?)

The (half?) primary part of Expr.Array
For example: [x * y | x <- [1, 2, 3], y <- [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 <- [1, 2, 3], y <- [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.Array.ListCompNames names)
      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
      names - the value for the names 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.Array.ListCompNames names)
    • 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
    • names

      @NotNull public @NotNull Expr.Array.ListCompNames names()
      Returns the value of the names record component.
      Returns:
      the value of the names record component