  We study the Singleton-type bound that provides an upper limit on the minimum
distance of locally repairable codes. We present an improved bound by carefully
analyzing the combinatorial structure of the repair sets. Thus, we show the
previous bound is unachievable for certain parameters. We then also provide
explicit constructions of optimal codes that show that for certain parameters
the new bound is sharp. Additionally, as a byproduct, some previously known
codes are shown to attain the new bound and are thus proved to be optimal.
