 }
 
 //===--- R refined protocol (like RandomAccessIndexType) ------------------===//
-protocol R_ : F_ {
+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)
 }
 
-protocol R : F, R_ {}
-
 // 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 {
+func ~> <I: R>(x: I, args: (_Distance, (I))) -> Int {
   let other = args.1
   I.sub(other, y: x)
   println("R")


//===--- 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_ {
  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 {
  let other = args.1
  return x.distance(other)
}

}

// Default Implementation of distance for F's
func ~> <I: F>(self_:I, (_Distance, (I))) -> Int {
  self_.successor() // Use an F-specific operation
  println("F")
  return 0
