package evidence
- Alphabetic
- By Inheritance
- evidence
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
<~<[-A, +B] = As[A, B]
A convenient type alias for As, this declares that A is a subtype of B, and should be able to be a B is expected.
-
type
===[A, B] = Is[A, B]
A convenient type alias for Is, which declares that A is the same type as B.
-
type
>~>[+B, -A] = As[A, B]
A flipped alias, for those used to their arrows running left to right
-
sealed abstract
class
As[-A, +B] extends Serializable
As substitutability: A better
<:<As substitutability: A better
<:<This class exists to aid in the capture proof of subtyping relationships, which can be applied in other context to widen other type
A As Bholds wheneverAcould be used in any negative context that expects aB. (e.g. if you could pass anAinto any function that expects aBas input.)This code was ported directly from scalaz to cats using this version from scalaz: https://github.com/scalaz/scalaz/blob/a89b6d63/core/src/main/scala/scalaz/Liskov.scala
The original contribution to scalaz came from Jason Zaugg
- sealed abstract class AsInstances extends AnyRef
-
abstract
class
Is[A, B] extends Serializable
A value of
A Is Bis proof that the typesAandBare the same.A value of
A Is Bis proof that the typesAandBare the same. More powerfully, it asserts that they have the same meaning in all type contexts. This can be a more powerful assertion thanA =:= Band is more easily used in manipulation of types while avoiding (potentially erroneous) coercions.A Is Bis also known as Leibniz equality. - sealed abstract class IsInstances extends AnyRef
-
type
Leibniz[A, B] = Is[A, B]
This type level equality represented by
Isis referred to as "Leibniz equality", and it had the name "Leibniz" in the scalaz https://en.wikipedia.org/wiki/Gottfried_Wilhelm_Leibniz -
type
Liskov[-A, +B] = As[A, B]
The property that a value of type A can be used in a context expecting a B if A <~< B is referred to as the "Liskov Substitution Principle", which is named for Barbara Liskov: https://en.wikipedia.org/wiki/Barbara_Liskov
Value Members
- object As extends AsInstances with AsSupport with Serializable
- object Is extends IsInstances with IsSupport with Serializable