typelevel / skunk

A data access library for Scala + Postgres.
https://typelevel.org/skunk/
MIT License
1.59k stars 163 forks source link

Should AppliedFragment Monoid use spaces? #1110

Open matthughes opened 4 months ago

matthughes commented 4 months ago

When combining AppliedFragments, should we intercalcate a space? I think technically that would violate the Monoid rules but I think that is what callers would want 99% of the time.

  /** `AppliedFragment` is a monoid. */
  implicit val MonoidAppFragment: Monoid[AppliedFragment] =
    new Monoid[AppliedFragment] {
      def combine(x: AppliedFragment, y: AppliedFragment): AppliedFragment = x |+| y
      def empty: AppliedFragment = AppliedFragment.empty
    }