New StackOverflow Question: TotallyLazy functional code in Java

51 views
Skip to first unread message

stacko...@mg.bodar.com

unread,
May 22, 2017, 8:17:34 AM5/22/17
to total...@googlegroups.com

TotallyLazy functional code in Java

Asked by Chris Nash on 2013-06-26T21:45:52Z

Reply on StackOverflow

I am attempting to use the functional library TotallyLazy, in Java. I am programming in AIDE on Android. I have this code which doesn't work:

package net.intrepidis;
import java.util.Comparator;
import static com.googlecode.totallylazy.Sequences.sequence;
import static com.googlecode.totallylazy.comparators.Comparators.ascending;

public class FunctionalTest
{
    public static void Go()
    {
        sequence(34, 25, 62)
            .sort(ascending());
    }
}

If I use this line instead then it works:

            .sort((Comparator<Comparable>)ascending());

However, that looks wrong to me, and goes against the grain of the framework. What am I doing wrong? Is it just because the Java version used by AIDE doesn't allow for the abbreviated code?

Reply on StackOverflow
Reply all
Reply to author
Forward
0 new messages