1. 8
  1.  

  2. 1

    Looks like the same approach used in Haskell’s HoleyMonoid library, which is also used to implement the excellent formatting lib.

    1. 1

      Yes, it’s exactly the same, and directly inspired by the latter. :-)