-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Compile Scala with Triplequote Hydra * Refactoring to workaround initialization issue of package object with inheritance * added hydra to .gitignore * Test added hydra to test impact on travis * fix * fix * format * update hydra * remove redudant plugin file * added metrics server config/reformat * fix metrics conf * added finite duration instance package / updated hydra * remove finiteDuration package
- Loading branch information
1 parent
b504edc
commit 8069e09
Showing
57 changed files
with
1,281 additions
and
1,196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.hydra | ||
project/boot | ||
target | ||
.ensime | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# mandatory: include the built-in settings tree | ||
include "application.conf" | ||
|
||
triplequote.dashboard.client { | ||
# Optional user ID override | ||
# metricsUserId = ${user.name} | ||
|
||
# Optional host ID (e.g. hostname) | ||
# metricsHostId = "" | ||
|
||
# Server address to push the metrics data | ||
serverUrl = "https://dashboard.triplequote.com/metrics" | ||
|
||
# Optional HTTP basic authentication | ||
clientUsername = ${?HYDRA_METRICS_USERNAME} | ||
clientPassword = ${?HYDRA_METRICS_PASSWORD} | ||
} |
36 changes: 36 additions & 0 deletions
36
kernel/src/main/scala/cats/kernel/instances/AllInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait AllInstances | ||
extends BigDecimalInstances | ||
with BigIntInstances | ||
with BitSetInstances | ||
with BooleanInstances | ||
with ByteInstances | ||
with CharInstances | ||
with DoubleInstances | ||
with EqInstances | ||
with EitherInstances | ||
with DurationInstances | ||
with FloatInstances | ||
with FunctionInstances | ||
with HashInstances | ||
with IntInstances | ||
with ListInstances | ||
with LongInstances | ||
with MapInstances | ||
with OptionInstances | ||
with OrderInstances | ||
with PartialOrderInstances | ||
with QueueInstances | ||
with SetInstances | ||
with ShortInstances | ||
with StreamInstances | ||
with StringInstances | ||
with SymbolInstances | ||
with TupleInstances | ||
with UnitInstances | ||
with UUIDInstances | ||
with VectorInstances | ||
|
||
trait AllInstancesBinCompat0 extends FiniteDurationInstances |
33 changes: 33 additions & 0 deletions
33
kernel/src/main/scala/cats/kernel/instances/BigDecimalInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait BigDecimalInstances { | ||
implicit val catsKernelStdOrderForBigDecimal: Order[BigDecimal] with Hash[BigDecimal] = | ||
new BigDecimalOrder | ||
implicit val catsKernelStdGroupForBigDecimal: CommutativeGroup[BigDecimal] = | ||
new BigDecimalGroup | ||
} | ||
|
||
class BigDecimalGroup extends CommutativeGroup[BigDecimal] { | ||
val empty: BigDecimal = BigDecimal(0) | ||
def combine(x: BigDecimal, y: BigDecimal): BigDecimal = x + y | ||
def inverse(x: BigDecimal): BigDecimal = -x | ||
override def remove(x: BigDecimal, y: BigDecimal): BigDecimal = x - y | ||
} | ||
|
||
class BigDecimalOrder extends Order[BigDecimal] with Hash[BigDecimal] { | ||
|
||
def hash(x: BigDecimal): Int = x.hashCode() | ||
|
||
def compare(x: BigDecimal, y: BigDecimal): Int = x.compare(y) | ||
|
||
override def eqv(x: BigDecimal, y: BigDecimal): Boolean = x == y | ||
override def neqv(x: BigDecimal, y: BigDecimal): Boolean = x != y | ||
override def gt(x: BigDecimal, y: BigDecimal): Boolean = x > y | ||
override def gteqv(x: BigDecimal, y: BigDecimal): Boolean = x >= y | ||
override def lt(x: BigDecimal, y: BigDecimal): Boolean = x < y | ||
override def lteqv(x: BigDecimal, y: BigDecimal): Boolean = x <= y | ||
|
||
override def min(x: BigDecimal, y: BigDecimal): BigDecimal = x.min(y) | ||
override def max(x: BigDecimal, y: BigDecimal): BigDecimal = x.max(y) | ||
} |
32 changes: 32 additions & 0 deletions
32
kernel/src/main/scala/cats/kernel/instances/BigIntInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait BigIntInstances { | ||
implicit val catsKernelStdOrderForBigInt: Order[BigInt] with Hash[BigInt] = | ||
new BigIntOrder | ||
implicit val catsKernelStdGroupForBigInt: CommutativeGroup[BigInt] = | ||
new BigIntGroup | ||
} | ||
|
||
class BigIntGroup extends CommutativeGroup[BigInt] { | ||
val empty: BigInt = BigInt(0) | ||
def combine(x: BigInt, y: BigInt): BigInt = x + y | ||
def inverse(x: BigInt): BigInt = -x | ||
override def remove(x: BigInt, y: BigInt): BigInt = x - y | ||
} | ||
|
||
class BigIntOrder extends Order[BigInt] with Hash[BigInt] { | ||
|
||
def hash(x: BigInt): Int = x.hashCode() | ||
def compare(x: BigInt, y: BigInt): Int = x.compare(y) | ||
|
||
override def eqv(x: BigInt, y: BigInt): Boolean = x == y | ||
override def neqv(x: BigInt, y: BigInt): Boolean = x != y | ||
override def gt(x: BigInt, y: BigInt): Boolean = x > y | ||
override def gteqv(x: BigInt, y: BigInt): Boolean = x >= y | ||
override def lt(x: BigInt, y: BigInt): Boolean = x < y | ||
override def lteqv(x: BigInt, y: BigInt): Boolean = x <= y | ||
|
||
override def min(x: BigInt, y: BigInt): BigInt = x.min(y) | ||
override def max(x: BigInt, y: BigInt): BigInt = x.max(y) | ||
} |
31 changes: 31 additions & 0 deletions
31
kernel/src/main/scala/cats/kernel/instances/BitSetInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
import scala.collection.immutable.BitSet | ||
|
||
trait BitSetInstances { | ||
implicit val catsKernelStdOrderForBitSet: PartialOrder[BitSet] with Hash[BitSet] = | ||
new BitSetPartialOrder | ||
|
||
implicit val catsKernelStdSemilatticeForBitSet: BoundedSemilattice[BitSet] = | ||
new BitSetSemilattice | ||
} | ||
|
||
class BitSetPartialOrder extends PartialOrder[BitSet] with Hash[BitSet] { | ||
def hash(x: BitSet): Int = x.hashCode() | ||
|
||
def partialCompare(x: BitSet, y: BitSet): Double = | ||
if (x eq y) 0.0 | ||
else if (x.size < y.size) if (x.subsetOf(y)) -1.0 else Double.NaN | ||
else if (y.size < x.size) if (y.subsetOf(x)) 1.0 else Double.NaN | ||
else if (x == y) 0.0 | ||
else Double.NaN | ||
|
||
override def eqv(x: BitSet, y: BitSet): Boolean = | ||
x == y | ||
} | ||
|
||
class BitSetSemilattice extends BoundedSemilattice[BitSet] { | ||
def empty: BitSet = BitSet.empty | ||
def combine(x: BitSet, y: BitSet): BitSet = x | y | ||
} |
24 changes: 24 additions & 0 deletions
24
kernel/src/main/scala/cats/kernel/instances/BooleanInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait BooleanInstances { | ||
implicit val catsKernelStdOrderForBoolean: Order[Boolean] with Hash[Boolean] = | ||
new BooleanOrder | ||
} | ||
|
||
class BooleanOrder extends Order[Boolean] with Hash[Boolean] { | ||
|
||
def hash(x: Boolean): Int = x.hashCode() | ||
def compare(x: Boolean, y: Boolean): Int = | ||
if (x == y) 0 else if (x) 1 else -1 | ||
|
||
override def eqv(x: Boolean, y: Boolean): Boolean = x == y | ||
override def neqv(x: Boolean, y: Boolean): Boolean = x != y | ||
override def gt(x: Boolean, y: Boolean): Boolean = x && !y | ||
override def lt(x: Boolean, y: Boolean): Boolean = !x && y | ||
override def gteqv(x: Boolean, y: Boolean): Boolean = x == y || x | ||
override def lteqv(x: Boolean, y: Boolean): Boolean = x == y || y | ||
|
||
override def min(x: Boolean, y: Boolean): Boolean = x && y | ||
override def max(x: Boolean, y: Boolean): Boolean = x || y | ||
} |
34 changes: 34 additions & 0 deletions
34
kernel/src/main/scala/cats/kernel/instances/ByteInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait ByteInstances { | ||
implicit val catsKernelStdOrderForByte: Order[Byte] with Hash[Byte] = new ByteOrder | ||
implicit val catsKernelStdGroupForByte: CommutativeGroup[Byte] = new ByteGroup | ||
} | ||
|
||
class ByteGroup extends CommutativeGroup[Byte] { | ||
def combine(x: Byte, y: Byte): Byte = (x + y).toByte | ||
def empty: Byte = 0 | ||
def inverse(x: Byte): Byte = (-x).toByte | ||
override def remove(x: Byte, y: Byte): Byte = (x - y).toByte | ||
} | ||
|
||
class ByteOrder extends Order[Byte] with Hash[Byte] { | ||
|
||
def hash(x: Byte): Int = x.hashCode() | ||
|
||
def compare(x: Byte, y: Byte): Int = | ||
if (x < y) -1 else if (x > y) 1 else 0 | ||
|
||
override def eqv(x: Byte, y: Byte): Boolean = x == y | ||
override def neqv(x: Byte, y: Byte): Boolean = x != y | ||
override def gt(x: Byte, y: Byte): Boolean = x > y | ||
override def gteqv(x: Byte, y: Byte): Boolean = x >= y | ||
override def lt(x: Byte, y: Byte): Boolean = x < y | ||
override def lteqv(x: Byte, y: Byte): Boolean = x <= y | ||
|
||
override def min(x: Byte, y: Byte): Byte = | ||
java.lang.Math.min(x.toInt, y.toInt).toByte | ||
override def max(x: Byte, y: Byte): Byte = | ||
java.lang.Math.max(x.toInt, y.toInt).toByte | ||
} |
18 changes: 18 additions & 0 deletions
18
kernel/src/main/scala/cats/kernel/instances/CharInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait CharInstances { | ||
implicit val catsKernelStdOrderForChar = new CharOrder | ||
} | ||
|
||
class CharOrder extends Order[Char] with Hash[Char] { | ||
def hash(x: Char): Int = x.hashCode() | ||
def compare(x: Char, y: Char): Int = | ||
if (x < y) -1 else if (x > y) 1 else 0 | ||
override def eqv(x: Char, y: Char): Boolean = x == y | ||
override def neqv(x: Char, y: Char): Boolean = x != y | ||
override def gt(x: Char, y: Char): Boolean = x > y | ||
override def gteqv(x: Char, y: Char): Boolean = x >= y | ||
override def lt(x: Char, y: Char): Boolean = x < y | ||
override def lteqv(x: Char, y: Char): Boolean = x <= y | ||
} |
33 changes: 33 additions & 0 deletions
33
kernel/src/main/scala/cats/kernel/instances/DoubleInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
trait DoubleInstances { | ||
implicit val catsKernelStdOrderForDouble: Order[Double] with Hash[Double] = new DoubleOrder | ||
implicit val catsKernelStdGroupForDouble: CommutativeGroup[Double] = new DoubleGroup | ||
} | ||
|
||
class DoubleGroup extends CommutativeGroup[Double] { | ||
def combine(x: Double, y: Double): Double = x + y | ||
def empty: Double = 0D | ||
def inverse(x: Double): Double = -x | ||
override def remove(x: Double, y: Double): Double = x - y | ||
} | ||
|
||
class DoubleOrder extends Order[Double] with Hash[Double] { | ||
|
||
def hash(x: Double): Int = x.hashCode() | ||
def compare(x: Double, y: Double): Int = | ||
java.lang.Double.compare(x, y) | ||
|
||
override def eqv(x: Double, y: Double): Boolean = x == y | ||
override def neqv(x: Double, y: Double): Boolean = x != y | ||
override def gt(x: Double, y: Double): Boolean = x > y | ||
override def gteqv(x: Double, y: Double): Boolean = x >= y | ||
override def lt(x: Double, y: Double): Boolean = x < y | ||
override def lteqv(x: Double, y: Double): Boolean = x <= y | ||
|
||
override def min(x: Double, y: Double): Double = | ||
Math.min(x, y) | ||
override def max(x: Double, y: Double): Double = | ||
Math.max(x, y) | ||
} |
47 changes: 47 additions & 0 deletions
47
kernel/src/main/scala/cats/kernel/instances/DurationInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package cats.kernel | ||
package instances | ||
|
||
import scala.concurrent.duration.Duration | ||
|
||
trait DurationInstances { | ||
implicit val catsKernelStdOrderForDuration: Order[Duration] with Hash[Duration] = new DurationOrder | ||
implicit val catsKernelStdGroupForDuration: CommutativeGroup[Duration] = new DurationGroup | ||
} | ||
|
||
// Duration.Undefined, Duration.Inf, Duration.MinusInf | ||
|
||
/** | ||
* This ordering is valid for all defined durations. | ||
* | ||
* The value Duration.Undefined breaks our laws, because undefined | ||
* values are not equal to themselves. | ||
*/ | ||
class DurationOrder extends Order[Duration] with Hash[Duration] { | ||
def hash(x: Duration): Int = x.hashCode() | ||
|
||
def compare(x: Duration, y: Duration): Int = x.compare(y) | ||
|
||
override def eqv(x: Duration, y: Duration): Boolean = x == y | ||
override def neqv(x: Duration, y: Duration): Boolean = x != y | ||
override def gt(x: Duration, y: Duration): Boolean = x > y | ||
override def gteqv(x: Duration, y: Duration): Boolean = x >= y | ||
override def lt(x: Duration, y: Duration): Boolean = x < y | ||
override def lteqv(x: Duration, y: Duration): Boolean = x <= y | ||
|
||
override def min(x: Duration, y: Duration): Duration = x.min(y) | ||
override def max(x: Duration, y: Duration): Duration = x.max(y) | ||
} | ||
|
||
/** | ||
* This group models addition, but has a few problematic edge cases. | ||
* | ||
* 1. finite values can overflow, throwing an exception | ||
* 2. inf + (-inf) = undefined, not zero | ||
* 3. undefined + zero = undefined | ||
*/ | ||
class DurationGroup extends CommutativeGroup[Duration] { | ||
def empty: Duration = Duration.Zero | ||
def inverse(x: Duration): Duration = -x | ||
def combine(x: Duration, y: Duration): Duration = x + y | ||
override def remove(x: Duration, y: Duration): Duration = x - y | ||
} |
Oops, something went wrong.