<commit_before>object Rank2Poly {
  type Id[T] = T
  type Const[C] = {
    type λ[T] = C
  }

  trait ~>[F[_], G[_]] {
    type λ[T] = F[T] => G[T]
    def apply[T](x : F[T]) : G[T]
    def univInst[T] : λ[T] = apply _ 
  }

  // Use of dependent type h.λ[T] essential here
  implicit def univInst[F[_], G[_], T](h : F ~> G) : h.λ[T] = h.univInst

  object identity extends (Id ~> Id) {
    def apply[T](t : T) = t
  }

  object singleton extends (Id ~> Set) {
    def apply[T](t : T) = Set(t)
  }

  object choose extends (Set ~> Option) {
    def apply[T](s : Set[T]) = s.headOption
  }

  object list extends (Id ~> List) {
    def apply[T](t : T) = List(t)
  }
  
  object headOption extends (List ~> Option) {
    def apply[T](t : List[T]) = t.headOption
  }
  
  object isDefined extends (Option ~> Const[Boolean]#λ) {
    def apply[T](o : Option[T]) = o.isDefined
  }
  
  object get extends (Option ~> Id) {
    def apply[T](o : Option[T]) : T = o.get
  }
  <commit_msg>No need for univInst, use apply directly.<commit_after>object Rank2Poly {
  type Id[T] = T
  type Const[C] = {
    type λ[T] = C
  }

  trait ~>[F[_], G[_]] {
    type λ[T] = F[T] => G[T]
    def apply[T](x : F[T]) : G[T]
  }

  // Use of dependent type h.λ[T] essential here
  implicit def univInst[F[_], G[_], T](h : F ~> G) : h.λ[T] = h.apply _

  object identity extends (Id ~> Id) {
    def apply[T](t : T) = t
  }

  object singleton extends (Id ~> Set) {
    def apply[T](t : T) = Set(t)
  }

  object choose extends (Set ~> Option) {
    def apply[T](s : Set[T]) = s.headOption
  }

  object list extends (Id ~> List) {
    def apply[T](t : T) = List(t)
  }
  
  object headOption extends (List ~> Option) {
    def apply[T](t : List[T]) = t.headOption
  }
  
  object isDefined extends (Option ~> Const[Boolean]#λ) {
    def apply[T](o : Option[T]) = o.isDefined
  }
  
  object get extends (Option ~> Id) {
    def apply[T](o : Option[T]) : T = o.get
  }
  
{'fraction_non_alphanumeric': 0.1820051413881748, 'fraction_numerical': 0.0010282776349614395, 'mean_word_length': 2.5706422018348625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '3582171', 'n_tokens_mistral': 816, 'n_tokens_neox': 797, 'n_words': 212}