 
 //===--- D refined protocol (like R, but with a custom distance) ----------===//
 // Users who want to provide a custom distance function will use this protocol
-protocol D_ : R_ {
+protocol D : R {
   func distance(y: Self) -> Int
 }
 
-protocol D : R, D_ {}
-
 // Dispatch to D's distance() requirement
 // Only the author of D needs to see this implementation.
-func ~> <I: D_>(x:I, args: (_Distance, (I))) -> Int {
+func ~> <I: D>(x:I, args: (_Distance, (I))) -> Int {
   let other = args.1
   return x.distance(other)
 }


//===--- F "base" protocol (like ForwardIndexType) ------------------------===//

// Protocols with default implementations are broken into two parts, a
// base and a more-refined part.  From the user's point-of-view,
// however, F_ and F should look like a single protocol.  This
// technique gets used throughout the standard library to break
// otherwise-cyclic protocol dependencies, which the compiler isn't
// yet smart enough to handle.
protocol F_ {
  // Non-defaulted requirements of F go here
  func successor() -> Self
}

protocol F : F_ {
  // This requirement allows generic distance() to find default
  // implementations.  Only the author of F and the author of a
  // refinement of F having a non-default distance implementation need

}

//===--- R refined protocol (like RandomAccessIndexType) ------------------===//
protocol R : F {
  // Non-defaulted requirements of R go here, e.g. something to
  // measure the distance in O(1)
  static func sub(x: Self, y: Self)
}

// R has its own default implementation of distance, which is O(1).
// Only the author of R needs to see this implementation.
func ~> <I: R>(x: I, args: (_Distance, (I))) -> Int {
  let other = args.1
  I.sub(other, y: x)
  println("R")
