<commit_before>import PolyFun._

// TODO zip/unzip
// TODO concat
// TODO init/last
// TODO reverse
// TODO zipper
// TODO hApply
// TODO Nat/type indexed get/put
// TODO Value/type contains
// TODO take/drop
// TODO Convert <=> case class/ProductN
// TODO Lenses
// TODO http://stackoverflow.com/questions/7606587
// TODO Checked conversion from Seq[T]

sealed trait HList

final case class HCons[+H, +T <: HList](head : H, tail : T) extends HList {
  import HList._
  
  def ::[T](v : T) = HCons(v, this)
  override def toString = head+" :: "+tail.toString
}

trait InvariantHCons[H, T <: HList] {
  import HList._

  def map[F[_], G[_], Out](f : F ~> G)(implicit mapper : Mapper[F, G, H :: T, Out]) : Out
  def map[F[_], OutH, OutT <: HList](f : F ~> Const[OutH]#λ)(implicit mapper : Mapper[F, Const[OutH]#λ, H :: T, OutH :: OutT]) : OutH :: OutT
  
  def foldLeft[R, F[_]](z : R)(f : F ~> Const[R]#λ)(op : (R, R) => R)(implicit folder : LeftFolder[H :: T, R, F]) : R

  def unify[Out <: HList](implicit unifier : Unifier[H :: T, Out]) : Out
  
  def toList[Lub](implicit l : ToList[H :: T, Lub]) : List[Lub]
}

trait HNil extends HList {
  def ::[T](v : T) = HCons(v, this)
  override def toString = "HNil"
    
  def map[F](f : F) : HNil = HNil
  
  def foldLeft[R, F[_]](f : F ~> Const[R]#λ)(z : R)(op : (R, R) => R) : R = z
  
  def unify : HNil = HNil
  
  def toList = Nil
}

case object HNil extends HNil
  
trait LowPriorityHList {
  type ::[+H, +T <: HList] = HCons[H, T]
  val :: = HCons<commit_msg>More HNil/HCons signature consistency.<commit_after>import PolyFun._

// TODO zip/unzip
// TODO concat
// TODO init/last
// TODO reverse
// TODO zipper
// TODO hApply
// TODO Nat/type indexed get/put
// TODO Value/type contains
// TODO take/drop
// TODO Convert <=> case class/ProductN
// TODO Lenses
// TODO http://stackoverflow.com/questions/7606587
// TODO Checked conversion from Seq[T]

sealed trait HList

final case class HCons[+H, +T <: HList](head : H, tail : T) extends HList {
  import HList._
  
  def ::[T](v : T) = HCons(v, this)
  override def toString = head+" :: "+tail.toString
}

trait InvariantHCons[H, T <: HList] {
  import HList._

  def map[F[_], G[_], Out](f : F ~> G)(implicit mapper : Mapper[F, G, H :: T, Out]) : Out
  def map[F[_], OutH, OutT <: HList](f : F ~> Const[OutH]#λ)(implicit mapper : Mapper[F, Const[OutH]#λ, H :: T, OutH :: OutT]) : OutH :: OutT
  
  def foldLeft[R, F[_]](z : R)(f : F ~> Const[R]#λ)(op : (R, R) => R)(implicit folder : LeftFolder[H :: T, R, F]) : R

  def unify[Out <: HList](implicit unifier : Unifier[H :: T, Out]) : Out
  
  def toList[Lub](implicit l : ToList[H :: T, Lub]) : List[Lub]
}

trait HNil extends HList {
  def ::[T](v : T) = HCons(v, this)
  override def toString = "HNil"
    
  def map[F[_], G[_]](f : F ~> G) : HNil = HNil
  
  def foldLeft[R, F[_]](f : F ~> Const[R]#λ)(z : R)(op : (R, R) => R) : R = z
  
  def unify : HNil = HNil
  
  def toList = Nil
}

case object HNil extends HNil
  
trait LowPriorityHList {
  type ::[+H, +T <: HList] = HCons[H, T]
  val :: = HCons
{'fraction_non_alphanumeric': 0.18380672543258245, 'fraction_numerical': 0.004570682337577538, 'mean_word_length': 3.1573948439620083, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 18, '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': '6225018', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1241, 'n_words': 360}