public static <A> Equal<List<A>> listEqual(final Equal<A> ea) {
    return equal(a1 -> a2 -> {
      List<A> x1 = a1;
      List<A> x2 = a2;

      while (x1.isNotEmpty() && x2.isNotEmpty()) {
        if (!ea.eq(x1.head(), x2.head()))
          return false;

        x1 = x1.tail();
        x2 = x2.tail();
      }

      return x1.isEmpty() && x2.isEmpty();
    });
  }