The monoid instance for [a] is left-biased. One way to
demonstrate what I'm aiming at is with the following two
definitions:
good ∷ Applicative f ⇒ Semigroup (f ()) ⇒ f ()
good = pure () <> good
bad ∷ Applicative f ⇒ Semigroup (f ()) ⇒ f ()
bad = bad <> pure ()
Here we can see that good @[] is productive whereas bad @[]
diverges. The same issue can have similar consequences for
performance (runtime and memory usage). So my question is, is
there a general guideline for whether I should design my
semigroup to be left- or right biased? I'd argue that similar
things should be taken into consideration when writing/using
Foldables. Perhaps this is the reason that both foldl and
foldr are instance methods?