   @inlinable
   public func chunked<Subject: Equatable>(
     on projection: @escaping (Element) -> Subject
-  ) -> LazyChunked<Elements> {
+  ) -> LazyChunked<Elements, Subject> {
     LazyChunked(
       base: elements,
-      belongInSameGroup: { projection($0) == projection($1) })
+      projection: projection,
+      belongInSameGroup: ==)
   }
 }
 

    
    return result
  }

  /// Returns a collection of subsequences of this collection, chunked by
  /// grouping elements that project to the same value.

  
  @inlinable
  public var endIndex: Index {
    Index(lowerBound: base.endIndex)
  }
  
  @inlinable
  public func index(after i: Index) -> Index {
    precondition(i != endIndex, "Can't advance past endIndex")
    let upperBound = i.upperBound ?? endOfChunk(startingAt: i.lowerBound)
    guard upperBound != base.endIndex else { return endIndex }
    let end = endOfChunk(startingAt: upperBound)
    return Index(lowerBound: upperBound, upperBound: end)
  }
  
  @inlinable
  public subscript(position: Index) -> Base.SubSequence {
    let upperBound = position.upperBound
      ?? endOfChunk(startingAt: position.lowerBound)
    return base[position.lowerBound..<upperBound]
  }
}
