title: Explore shapeless's `Last` Type Class
body: <p>I typed out, more or less, the <code>Last</code> type class of <code>shapeless</code>'s <code>Last</code>:</p>
  
  <pre><code>import shapeless.{HList, HNil, ::}
  
  trait Last[H &lt;: HList] {
    type Out
    def last(in: H): Out
  }
  </code></pre>
  
  <p>Then, I typed out the, as I understand, type class instances of <code>Last</code> for <code>HList</code>:</p>
  
  <pre><code>object Last {
    type Aux[L &lt;: HList, O] = Last[L] { type Out = O }
  
    // arrived at the truly `last` item, i.e. `H`
    implicit def singleLast[H]: Aux[H :: HNil, H] = new Last[H :: HNil] {
      override type Out = H
      override def last(in: H :: HNil): H = in.head
    }
  
    // I believe this is the inductive step
    implicit def hlistLast[H, T &lt;: HList, OutT]
    (implicit lt : Last.Aux[T, OutT]): Aux[H :: T, OutT] =
      new Last[H :: T] {
        type Out = OutT
        def apply(l : H :: T): Out = lt(l.tail)
      }
  }
  </code></pre>
  
  <p>However, I don't understand why it fails to compile:</p>
  
  <pre><code>[error] /Users/kevinmeredith/Workspace/shapeless-sandbox/src/
        main/scala/net/ops.scala:17: net.Last.Aux[T,OutT] does not take parameters
  [error]       def apply(l : H :: T): Out = lt(l.tail)
  [error]                                      ^
  [error] one error found
  [error] (compile:compileIncremental) Compilation failed
  </code></pre>
  
  <p>How can I fix this compile-time error?</p>