“Java lipatan kiri” Kode Jawaban

Java lipatan kiri

# https://apocalisp.wordpress.com/2008/04/22/left-fold-in-java/
# now that there is lambdas in Java it's certainly easier but
# this one should stay with us for it is beautiful!
  
  public static <A, B> A fold(F<A, F<B, A>> f, A z, Iterable<B> xs)
    { A p = z;
      for (B x : xs)
        { p = f.f(p).f(x); }
      return p; }
Functional Platypus

Java lipatan kiri



public static String concatenate(List<Character> chars) {
        return chars
                .stream()
                .reduce(new StringBuilder(),
                                StringBuilder::append,
                                StringBuilder::append).toString();
    }


Wicked Whale

Jawaban yang mirip dengan “Java lipatan kiri”

Pertanyaan yang mirip dengan “Java lipatan kiri”

Lebih banyak jawaban terkait untuk “Java lipatan kiri” di Java

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya