Add support for lattices.

Since we started this project, Spire added support for boolean algebras,
heyting algebras, and lattices.

This commit adds type classes for these types.
can we describe a minimal implementation here? It is hard to trace through all the mutually recursive calls. The compiler won't help you if you don't define, it will just throw stack overflow.