These patterns would have been a lot nicer if `PartialFunction` had an `def unapply(arg: A): Option[B] = lift(arg)` method:
```scala
grouped match {
  case init :: List(Fill(hole)) :: last :: Nil => appended(last, prepended(init, hole))
  case init :: List(Fill(hole)) :: Nil         => prepended(init, hole)
  case         List(Fill(hole)) :: last :: Nil => appended(last, hole)
  case         List(Fill(hole)) :: Nil         => hole
  case _                                       => prepended(xs, collectionNil)
}
```