duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
Java 8 introduced lambdas to the Java language. While the design choices differ in many regards from Scala's functions, the underlying mechanics used to represent Java lambdas is flexible enough to be used as a target for the Scala compiler.
Java does not have canonical heirarchy of generic function types (ala scala.FunctionN
), but instead allows a lambda to be used as a shorthand for an anonymous implementation of an Functional Interface
Here's an example of creating a predicate that closes over one value:
import annotation.unchecked.uncheckedVariance | |
/** The trait of things that can be compared safely */ | |
trait Equals[-T] { | |
/** A witness of Equals' type parameter. Should only used for | |
* the constraint in EqlDecorator, hence, @uncheckedVariance should not be a problem. | |
*/ | |
type EqualsDomain = T @uncheckedVariance |
package com.lckymn.kevin.example; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* Visit http://goo.gl/X94gN for more details. | |
* | |
* @author Lee, SeongHyun (Kevin) / <a href="http://blog.lckymn.com">Kevin's Blog</a> |