title: Should 'Comparable<T>' be a 'Functional interface'?
body: <p>The definition of a functional interface is "A functional interface is an interface that has just one abstract method
  (aside from the methods of Object ), and thus represents a single function contract."</p>
  
  <p>According to this definition, the <code>Comparable&lt;T&gt;</code> is definitely a functional interface.</p>
  
  <p>The definition of a lambda expression is "A lambda expression is like a method: it provides a list of formal parameters
  and a body - an expression or block - expressed in terms of those parameters."</p>
  
  <p>Evaluation of a lambda expression produces an instance of a functional interface.</p>
  
  <p>Thus, the purpose of the lambda expression is to be able to create an instance of the functional interface, by implementing
  the single function of the functional interface. ie. to allow the creation of an instance with the single function.</p>
  
  <p>Let us look at <code>Comparable&lt;T&gt;</code>, is this interface designed for use as a single function?
  ie. was it designed for the creation of instances with this single function only?</p>
  
  <p>The documentation of <code>Comparable&lt;T&gt;</code> starts with "This interface imposes a total ordering on the objects of each class that
  implements it. This ordering is referred to as the class's natural ordering, and the class's compareTo method is referred
  to as its natural comparison method."</p>
  
  <p>The above sentence makes it clear that the <code>Comparable&lt;T&gt;</code> is not designed to be used as a single function, but is always
  meant to be implemented by a class, which has natural ordering for its instances, by adding this single function.</p>
  
  <p>Which would mean that it is not designed to be created by using a lambda expression?</p>
  
  <p>The point is that we would not have any object which is just Comparable only, it is meant to be implemented and thus used
  as an additional function for a class.</p>
  
  <p>So, is there a way in the Java language, by which creation of a lambda expression for <code>Comparable&lt;T&gt;</code> is prevented?
  Can the designer of an interface decide that this interface is meant to be implemented by a class and not meant to be
  created as an instance with this single method by use of a lambda expression?</p>
  
  <p>Simply because an interface happens to have a single abstract method, it should not be considered as a functional interface.</p>
  
  <p>Maybe, if Java provides an annotation like NotFunctional, it can be checked by the compiler that this interface is not used
  for the creation of a lambda expression, eg.</p>
  
  <pre><code>@NotFunctional
  public interface Comparable&lt;T&gt; { public int compareTo(T t); }
  </code></pre>