algebra.instances

Type members

Classlikes

class BigDecimalAlgebra(mc: MathContext) extends Field[BigDecimal] with Serializable
trait BigDecimalInstances extends BigDecimalInstances
class BigIntAlgebra extends CommutativeRing[BigInt] with Serializable
trait BigIntInstances extends BigIntInstances
class BitSetAlgebra extends GenBool[BitSet] with Serializable
trait BitSetInstances extends BitSetInstances
class BooleanAlgebra extends Bool[Boolean] with CommutativeRig[Boolean]

This commutative rig is different than the one obtained from GF(2).

This commutative rig is different than the one obtained from GF(2).

It uses || for plus, and && for times.

trait BooleanInstances extends BooleanInstances
class ByteAlgebra extends CommutativeRing[Byte] with Serializable
trait ByteInstances extends ByteInstances
trait CharInstances extends CharInstances
class DoubleAlgebra extends Field[Double] with Serializable

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

If you would prefer an absolutely lawful fractional value, you'll need to investigate rational numbers or more exotic types.

trait DoubleInstances extends DoubleInstances
class FloatAlgebra extends Field[Float] with Serializable

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

If you would prefer an absolutely lawful fractional value, you'll need to investigate rational numbers or more exotic types.

trait FloatInstances extends FloatInstances
class IntAlgebra extends CommutativeRing[Int] with Serializable
trait IntInstances extends IntInstances
trait ListInstances extends ListInstances
class LongAlgebra extends CommutativeRing[Long] with Serializable
trait LongInstances extends LongInstances
class MapAdditiveMonoid[K, V](V: AdditiveSemigroup[V]) extends AdditiveMonoid[Map[K, V]]
trait MapInstances extends MapInstances with MapInstances3
class MapSemiring[K, V](V: Semiring[V]) extends MapAdditiveMonoid[K, V] with Semiring[Map[K, V]]
trait OptionInstances extends OptionInstances
class SetBoolRng[A] extends BoolRng[Set[A]]
trait SetInstances extends SetInstances
class SetLattice[A] extends GenBool[Set[A]]
class SetSemiring[A] extends Semiring[Set[A]]
class ShortAlgebra extends CommutativeRing[Short] with Serializable
trait ShortInstances extends ShortInstances
trait StringInstances extends StringInstances
trait TupleInstances extends TupleInstances
class UnitAlgebra extends CommutativeRing[Unit]
trait UnitInstances extends UnitInstances