Type Classes

Why Are PureScript's Type Classes So Granular?

See Phil's explanation of Counterexamples of Type Classes

Relationships

This SVG file (WIP, but still helpful) shows the relationships between the type classes (inheritance hierarchy, dual relationships, usage frequency, and package location) throughout the ecosystem:

typeclass-relationships

Functions

There is also an Excel file (Type-Class-Functions.xlsx) that documents the functions of said type classes using a chart like so (Note: the following chart is long-vertically and short-horizontally to reduce horizontal scrolling. In the real chart, this is inverted):

Example1Example2
package
(the 'purescript-' prefix is omitted, so 'prelude' is really 'purescript-prelude')
preludeprelude
Type class nameFunctorFunctor
Function Definition
(Either defined in the initial type class (I) or dervied using that function (D))
ID
Alias symbol
(If no symbol exists, then there is no alias)
<$>$>
Alias infix direction & precedence
(direction is either left (L) or right (R)
precedence is 1..9)
L 4L 4
Type Parameter
(what the type that follows the type class (e.g. Functor f))
ff
Function NamemapvoidLeft
Constraints
(These usually appear in derived functions, but may also appear in initial functions)
Functor f
Return typef bf b
Arg 1(a -> b)f a
Arg 2f aa
.........
Arg N......

Laws

TODO

Category Theory