4PureScript has basic support for type classes via the ``class`` and ``instance`` keywords.
6Types appearing in class instances are must be of the form ``String``, ``Number``, ``Boolean``, or ``C t1 ... tn`` where ``C`` is a type constructor (including ``[]`` and ``->`` and ``t_i`` are types of the same form).
8Type class instances are resolved based on the order in which they appeared in the source files. In particular, overlapping instances are permitted.
10Here is an example of the ``Show`` typeclass, with instances for ``String``, ``Booleans`` and ``[]``::
15 instance showString :: Show String where
18 instance showBoolean :: Show Boolean where
22 instance showArray :: (Show a) => Show [a] where
24 show (x:xs) = show x ++ " : " ++ showArray xs
26 example = show [true, false]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list