<commit_before>package monocle.internal

import scalaz.{-\/, \/, \/-}

/**
 * (From Haskell) A Tagged s b value is a value b with an attached phantom type s.
 * This can be used in place of the more traditional but less safe idiom of passing in an undefined
 * value with the type, because unlike an (s -> b), a Tagged s b can't try to use the argument s as a real value.
 */
case class Tagged[S, B](untagged: B) extends AnyVal {
  def retag[T]: Tagged[T, B] = Tagged(untagged)
}

object Tagged {
  implicit val taggedProChoice = new ProChoice[Tagged] {
    override def left[A, B, C](pab : Tagged[A, B]): Tagged[A \/ C, B \/ C] =
      Tagged[A \/ C, B \/ C](-\/(pab.untagged))
    override def right[A, B, C](pab: Tagged[A, B]): Tagged[C \/ A, C \/ B] =
      Tagged[C \/ A, C \/ B](\/-(pab.untagged))

    def mapfst[A, B, C](fab: Tagged[A, B])(f: C => A): Tagged[C, B] = fab.retag[C]
    def mapsnd[A, B, C](fab: Tagged[A, B])(f: B => C): Tagged[A, C] = Tagged(f(fab.untagged))
  }
}

sealed abstract class TaggedInstances {
  implicit def taggedProChoice: ProChoice[Tagged] = new TaggedProChoice{}
}


private sealed trait TaggedProChoice extends ProChoice[Tagged]{
  override def left[A, B, C](pab : Tagged[A, B]): Tagged[A \/ C, B \/ C] =<commit_msg>Revert Tagged not to be a value class<commit_after>package monocle.internal

import scalaz.{-\/, \/, \/-}

/**
 * (From Haskell) A Tagged s b value is a value b with an attached phantom type s.
 * This can be used in place of the more traditional but less safe idiom of passing in an undefined
 * value with the type, because unlike an (s -> b), a Tagged s b can't try to use the argument s as a real value.
 */
case class Tagged[S, B](untagged: B) {
  def retag[T]: Tagged[T, B] = Tagged(untagged)
}

object Tagged {
  implicit val taggedProChoice = new ProChoice[Tagged] {
    override def left[A, B, C](pab : Tagged[A, B]): Tagged[A \/ C, B \/ C] =
      Tagged[A \/ C, B \/ C](-\/(pab.untagged))
    override def right[A, B, C](pab: Tagged[A, B]): Tagged[C \/ A, C \/ B] =
      Tagged[C \/ A, C \/ B](\/-(pab.untagged))

    def mapfst[A, B, C](fab: Tagged[A, B])(f: C => A): Tagged[C, B] = fab.retag[C]
    def mapsnd[A, B, C](fab: Tagged[A, B])(f: B => C): Tagged[A, C] = Tagged(f(fab.untagged))
  }
}

sealed abstract class TaggedInstances {
  implicit def taggedProChoice: ProChoice[Tagged] = new TaggedProChoice{}
}


private sealed trait TaggedProChoice extends ProChoice[Tagged]{
  override def left[A, B, C](pab : Tagged[A, B]): Tagged[A \/ C, B \/ C] =
{'fraction_non_alphanumeric': 0.16329766151407055, 'fraction_numerical': 0.0, 'mean_word_length': 3.2635135135135136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5519916', 'n_tokens_mistral': 996, 'n_tokens_neox': 961, 'n_words': 329}