26 lines
532 B
Markdown
26 lines
532 B
Markdown
|
|
# 11-haskell-typeclasses
|
||
|
|
|
||
|
|
This example shows intermediate Haskell abstraction with a custom type class and several instances.
|
||
|
|
|
||
|
|
It includes:
|
||
|
|
|
||
|
|
- a custom `Renderable` type class,
|
||
|
|
- instances for domain types and a report wrapper,
|
||
|
|
- a small CLI that uses one shared rendering interface, and
|
||
|
|
- a test suite run by `nix flake check`.
|
||
|
|
|
||
|
|
Useful commands:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
nix develop
|
||
|
|
cabal run
|
||
|
|
cabal run -- production failed 2
|
||
|
|
cabal test
|
||
|
|
|
||
|
|
nix build
|
||
|
|
./result/bin/mini-render production failed 2
|
||
|
|
|
||
|
|
nix run . -- production failed 2
|
||
|
|
nix flake check
|
||
|
|
```
|