|
Scala example source code file (OrderSyntax.scala)
The OrderSyntax.scala Scala example source codepackage scalaz package syntax /** Wraps a value `self` and provides methods related to `Order` */ final class OrderOps[F] private[syntax](val self: F)(implicit val F: Order[F]) extends Ops[F] { //// final def <(other: F): Boolean = F.lessThan(self, other) final def <=(other: F): Boolean = F.lessThanOrEqual(self, other) final def >(other: F): Boolean = F.greaterThan(self, other) final def >=(other: F): Boolean = F.greaterThanOrEqual(self, other) final def max(other: F): F = F.max(self, other) final def min(other: F): F = F.min(self, other) final def cmp(other: F): Ordering = F.order(self, other) final def ?|?(other: F): Ordering = F.order(self, other) final def lte(other: F): Boolean = F.lessThanOrEqual(self, other) final def gte(other: F): Boolean = F.greaterThanOrEqual(self, other) final def lt(other: F): Boolean = F.lessThan(self, other) final def gt(other: F): Boolean = F.greaterThan(self, other) //// } trait ToOrderOps extends ToEqualOps { implicit def ToOrderOps[F](v: F)(implicit F0: Order[F]) = new OrderOps[F](v) //// //// } trait OrderSyntax[F] extends EqualSyntax[F] { implicit def ToOrderOps(v: F): OrderOps[F] = new OrderOps[F](v)(OrderSyntax.this.F) def F: Order[F] //// //// } Other Scala examples (source code examples)Here is a short list of links related to this Scala OrderSyntax.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.