From 7841ffec7f0b602f19c687f06ae9aa9ce7351597 Mon Sep 17 00:00:00 2001 From: Marco Perone Date: Wed, 15 Mar 2023 12:37:47 +0100 Subject: [PATCH] update RenderableVertices documentation --- docs/how-to-create-a-machine.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/how-to-create-a-machine.md b/docs/how-to-create-a-machine.md index ed58824..37f647c 100644 --- a/docs/how-to-create-a-machine.md +++ b/docs/how-to-create-a-machine.md @@ -372,7 +372,8 @@ class RenderableVertices a where ``` It is used to list all the vertices of type `a` so that they can be rendered. -It has a default instance for types `a` satisfying `(Enum a, Bounded a)`, but you can overwrite it for more specific types. + +For your own types with `Enum` and `Bounded` instances, you can use the `AllVertices` newtype wrapper in conjunction with `deriving via` to derive a `RenderableVertices` instance which returns the list of all the terms of your type. Be aware that rendering a graph or topology with vertices of type `a` will try to print out every element of that type. It might not be a good idea to try to print out every value of type `Int`, for example...