> By the way, your code doesn't seem to give any way of producing inhabitants of `Vertex g`.
In fully polymorphic code (like clique) you indeed can't produce new inhabitants, or do anything else with the values of type `Vertex g`. However, if you know something about `Vertex g` then you can do certain things. For example, if we know that the type of vertices has `Ord` instance then we can compare them (as we do in `Relation`). And in very concrete code, e.g. operating on `Basic Int` values, you can create new inhabitants freely -- any number will do.
> Also, am I wrong to read `vertex` as a kind of `return`?
It is indeed very much like `return` or `pure`! We use it to inject a type into a sort of container type, in this case, into a graph type.
> I hope that I am not wrong to think that graphs should serve as just as good instances of monads as lists, if not better
Many `Graph` instances are `Monad`s. For example, `Basic` is a `Monad` (and many other things too). But on the other hand `Relation` is not a `Monad`, because it imposes the `Ord` constraint on the underlying type (and Haskell monads are not allowed that).
> While we're talking: thanks for this article; I enjoyed it a lot.
Thank you! I didn't expect so much interest to it, so I'm a bit overwhelmed to be honest :)
> My one suggestion is that I think that what you call a "clique" is usually called a "complete graph", with "clique" (implicitly, in G) reserved for subgraphs of G that happen to be complete.
Thanks, indeed "clique" may be not the best name... I decided to use it, because I would like to reserve "complete graph" to mean something like `clique [1..]` i.e. the complete graph on the whole universe. If we look from this perspective then something like `clique [1..10]` may look like a clique within some bigger graph. Anyway, I admit this may be confusing.