   return (nextIndex, result)
 }
 
+/// Instances of conforming types are used in internal `String`
+/// representation.
 internal protocol _StringElementType {
   class func _toUTF16CodeUnit(_: Self) -> UTF16.CodeUnit
   class func _fromUTF16CodeUnit(utf16: UTF16.CodeUnit) -> Self

  }
}

public protocol UnicodeCodecType {
  typealias CodeUnit

  init()

  ///
  /// Because of buffering, it is impossible to find the corresponing position
  /// in the generator for a given returned `UnicodeScalar` or an error.
  ///
  /// :param: `next`: a *generator* of code units to be decoded.
  mutating func decode<
    G : GeneratorType where G.Element == CodeUnit
  >(inout next: G) -> UnicodeDecodingResult

  /// Encode a `UnicodeScalar` as a series of `CodeUnit`\ s by `put`\
  /// 'ing each `CodeUnit` to `output`.
  class func encode<
    S : SinkType where S.Element == CodeUnit
  >(input: UnicodeScalar, inout output: S)
