alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (Tags.scala)

This example Scala source code file (Tags.scala) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Scala by Example" TM.

Learn more about this Scala project at its project page.

Java - Scala tags/keywords

conjunction, disjunction, dual, first, firstval, last, lastval, max, maxval, min, minval, multiplication, parallel, zip

The Tags.scala Scala example source code

package scalaz

/**
 * Type tags that are used to discriminate between alternative type class instances.
 *
 * @see [[scalaz.Tag]] and, `@@` in the package object [[scalaz]] .
 */
object Tags {
  /** Type tag to choose a [[scalaz.Semigroup]] instance that selects the first operand to append. */
  sealed trait FirstVal

  val FirstVal = Tag.of[FirstVal]

  /** Type tag to choose a [[scalaz.Semigroup]] instance that selects the last operand to append. */
  sealed trait LastVal

  val LastVal = Tag.of[LastVal]

  /** Type tag to choose a [[scalaz.Semigroup]] instance that selects the lesser of two operands. */
  sealed trait MinVal

  val MinVal = Tag.of[MinVal]

  /** Type tag to choose a [[scalaz.Semigroup]] instance that selects the greater of two operands. */
  sealed trait MaxVal

  val MaxVal = Tag.of[MaxVal]

  /** Type tag to choose a [[scalaz.Monoid]] instance that selects the first non-`zero` operand to append. */
  sealed trait First

  val First = Tag.of[First]

  /** Type tag to choose a [[scalaz.Monoid]] instance that selects the last non-`zero` operand to append. */
  sealed trait Last

  val Last = Tag.of[Last]

  /** Type tag to choose a [[scalaz.Monoid]] instance that selects the lesser of two operands, ignoring `zero`. */
  sealed trait Min

  val Min = Tag.of[Min]

  /** Type tag to choose a [[scalaz.Monoid]] instance that selects the greater of two operands, ignoring `zero`. */
  sealed trait Max

  val Max = Tag.of[Max]

  /** Type tag to choose a [[scalaz.Monoid]] instance for a numeric type that performs multiplication,
   *  rather than the default monoid for these types which by convention performs addition. */
  sealed trait Multiplication

  val Multiplication = Tag.of[Multiplication]

  /** Type tag to choose a [[scalaz.Monoid]] instance that inverts the operands to `append` before calling the
   *  natural [[scalaz.Monoid]] for the type.
   *
   *  Example:
   *  {{{
   *  import scalaz.{@@, Tag, Tags, Dual}
   *  import scalaz.std.string._
   *  import scalaz.syntax.monoid._
   *  import scalaz.Dual._
   *  Dual("World!") |+| Dual("Hello, ") // "Hello, World!"
   *  }}}
   */
  sealed trait Dual

  val Dual = Tag.of[Dual]

  /** Type tag to choose as [[scalaz.Applicative]] instance that performs zipping.
   *
   * @see [[scalaz.std.stream.streamZipApplicative]]
   */
  sealed trait Zip

  val Zip = Tag.of[Zip]

  /** Type tag to choose a [[scalaz.Monoid]] instance that performs disjunction (`||`) */
  sealed trait Disjunction

  val Disjunction = Tag.of[Disjunction]

  /** Type tag to choose a [[scalaz.Monoid]] instance that performs conjunction (`&&`) */
  sealed trait Conjunction

  val Conjunction = Tag.of[Conjunction]

  /** Type tag to choose a [[scalaz.Applicative]] instance that runs scalaz.concurrent.Futures in parallel. */
  sealed trait Parallel

  val Parallel = Tag.of[Parallel]

}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala Tags.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.