Singleton containers

Posted on 2018-05-12 by Oleg Grenrus lens

Singleton containers, all t a values have a single a value in it. We can use peekaboo as a Lens to extract the value inside.

There're plenty of instances, for example:

We can use Singleton to define Strong, the class used to characterise Lens in profunctor optics.

Strong and Strong' are equivalent, from Strong' direction is trivial:

but the other is more involved:

Site proudly generated by Hakyll