Back and forth between a Repr and an Each[A].
A not very impressive attempt to improve on string representations.
The original type class for providing the "empty" value of a particular type.
The original type class for providing the "empty" value of a particular type. Suitable only for types with a unique (useful) definition of empty - but that's a lot of types. You could easily recover the behavior of methods like Option.get or Seq.head by creating a default instance of Empty[A] which throws an exception.
The classic type classes for encoding value equivalence and hash codes.
Foreach is the common parent of View and Each.
Foreach is the common parent of View and Each.
A View always wraps an indeterminate number of Views and a single Each which provides the original basis. An Each may be composed from smaller Eaches but is otherwise atomic. The size of an Each is known, the size of a View may not be.
A richer function abstraction.
A richer function abstraction.
No way to avoid at least having apply as a member method if there's to be any hope of seeing these converted into scala.Functions.
When the operation has an A in negative position.
Name-based extractor methods.
Name-based extractor methods. These interfaces aren't necessary for it (thus "name-based") but provide helpful structure when used.
Contravariance vs.
Contravariance vs. implicits, the endless battle.
We return a java three-value enum from compare in preference
to a wild stab into the 2^32 states of an Int. This is a
controversial thing to do, in the year 2014. Not joking.
The classic type class for turning typed values into string representations.
When a Show type class is more trouble than it's worth.
When a Show type class is more trouble than it's worth. Not overriding toString here to leave open the possibility of using a synthetic toString, e.g. of case classes.
The Size hierarchy is: Size / \ Atomic Bounded / \ Infinite Precise
The Size hierarchy is: Size / \ Atomic Bounded / \ Infinite Precise
Precise implies the exact size is known. Infinite means it's infinite. Bounded is a size lower bound and a (possibly infinite) atomic upper bound. Size forms a partial order, with some liberties taken at present. Operations on sizes which are ill-defined will result in "Unknown", which encodes no available size information: Bounded(Zero, Infinite).
Invariants:
When a View is split into two disjoint views.
When a View is split into two disjoint views. Notably, that's span, partition, and splitAt.
Type classes and extractors for composing and decomposing an R into A -> B.
Type classes and extractors for composing and decomposing an R into A -> B. Somewhat conveniently for us, "cleave" is a word which has among its meanings "to adhere firmly and closely as though evenly and securely glued" as well as "to divide into two parts by a cutting blow".
When a View presents as a sequence of pairs.
When a View presents as a sequence of pairs. There may be two underlying views being zipped, or one view holding pairs.
Back and forth between a Repr and an Each[A]. Not especially classic in this presentation.