3PureScript has basic support for type classes via the `class` and `instance` keywords.
5Type class instances must be of the form `String`, `Number`, `Boolean`, `[t]` or `C t1 ... tn`, and only a single type class parameter is supported.
7Type class instances are resolved based on the order in which they appeared in the source files. In particular, overlapping instances are permitted.
13instance Show String where
16instance Show Boolean where
20instance (Show a) => Show [a] where
21 show arr = "[" ++ showArray arr ++ "]"
23showArray :: forall a. (Show a) => [a] -> String
26showArray (x:xs) = show x ++ ", " ++ showArray xs
28example = 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