All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ceylon.language.byIncreasing.ceylon Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
"Produces a comparator function which orders elements in 
 increasing order according to the [[Comparable]] value 
 returned by the given [[comparable]] function.
 
      \"Hello World!\".sort(byIncreasing(Character.lowercased))
 
 This function is intended for use with [[Iterable.sort]]
 and [[Iterable.max]]."
see (`function byDecreasing`,
     `function increasing`,
     `function Iterable.max`,
     `function Iterable.sort`)
tagged("Functions", "Comparisons")
shared Comparison byIncreasing
            (Value comparable(Element e))
            (Element x, Element y)
        given Value satisfies Comparable 
                => comparable(x)<=>comparable(y);

"A comparator function which orders elements in increasing 
 [[natural order|Comparable]].
 
        \"Hello World!\".sort(increasing)
 
 This function is intended for use with [[Iterable.sort]]
 and [[Iterable.max]]."
see (`function decreasing`,
     `function byIncreasing`,
     `function Iterable.max`,
     `function Iterable.sort`)
tagged("Comparisons")
shared Comparison increasing(Element x, Element y)
        given Element satisfies Comparable 
        => x<=>y;

"A comparator function which orders [[entries|Entry]] by 
 increasing [[natural order|Comparable]] of their 
 [[keys|Entry.key]].
        
 This function is intended for use with [[Iterable.sort]]
 and [[Iterable.max]]."
tagged("Comparisons")
shared Comparison increasingKey
            (Key->Anything x, Key->Anything y)
        given Key satisfies Comparable
        => x.key <=> y.key;

"A comparator function which orders [[entries|Entry]] by 
 increasing [[natural order|Comparable]] of their 
 [[items|Entry.item]].
        
 This function is intended for use with [[Iterable.sort]]
 and [[Iterable.max]]."
tagged("Comparisons")
shared Comparison increasingItem
        (Object->Item x, Object->Item y)
        given Item satisfies Comparable
        => x.item <=> y.item;





© 2015 - 2024 Weber Informatics LLC | Privacy Policy