bump dependencies
1 
package algebra 

2 
package lattice 

3  
4 
import scala.{specialized => sp} 

5  
6 
/**


7 
* A joinsemilattice (or upper semilattice) is a semilattice whose


8 
* operation is called "join", and which can be thought of as a least


9 
* upper bound.


10 
*/


11 
trait JoinSemilattice[@sp(Int, Long, Float, Double) A] extends Any with Serializable { self => 

12 
def join(lhs: A, rhs: A): A 

13  
14 
def joinSemilattice: Semilattice[A] = 

15 
new Semilattice[A] { 

16 
def combine(x: A, y: A): A = self.join(x, y) 

17 
}


18  
19 
def joinPartialOrder(implicit ev: Eq[A]): PartialOrder[A] = 

20 
joinSemilattice.asJoinPartialOrder 

21 
}


22  
23 
trait JoinSemilatticeFunctions[J[A] <: JoinSemilattice[A]] { 

24 
def join[@sp(Int, Long, Float, Double) A](x: A, y: A)(implicit ev: J[A]): A = 

25 
ev.join(x, y) 

26 
}


27  
28 
object JoinSemilattice extends JoinSemilatticeFunctions[JoinSemilattice] { 

29  
30 
/**


31 
* Access an implicit `JoinSemilattice[A]`.


32 
*/


33 
@inline final def apply[@sp(Int, Long, Float, Double) A](implicit ev: JoinSemilattice[A]): JoinSemilattice[A] = ev 

34  
35 
}

Read our documentation on viewing source code .