
14 Dec
2021
14 Dec
'21
2:23 p.m.
I find myself wanting to define instances of Semigroup (and Monoid) in a file that also imports GHC.Utils.Outputable and its `<>` operation on SDocs. At the moment I am dealing with the incompatibility by hiding the Outputable version and instead of writing `s1 <> s2` I write `hcat [s1, s2]`. This workaround seems ugly and vaguely embarrassing. How are others dealing with this issue? Would it be sensible simply to make SDoc an instance of Semigroup (and Monoid), or would we be concerned about potential additional overhead at compile time? Norman