@@ -12,6 +12,7 @@ module Rel8.Type.Semigroup
15+import Data.Function ( on )
15import Data.Kind ( Constraint, Type )
16import Data.Kind ( Constraint, Type )
16import Data.List.NonEmpty ( NonEmpty )
17import Data.List.NonEmpty ( NonEmpty )
17import Prelude ()
18import Prelude ()
@@ -31,6 +32,7 @@ import {-# SOURCE #-} Rel8.Expr ( Expr )
31import Rel8.Expr.Opaleye ( zipPrimExprsWith )
32import Rel8.Expr.Opaleye ( zipPrimExprsWith )
32import Rel8.Schema.Null ( Sql )
33import Rel8.Schema.Null ( Sql )
33import Rel8.Type ( DBType )
34import Rel8.Type ( DBType )
35+import Rel8.Type.Array ( toPrimArray )
36import Data.Text ( Text )
38import Data.Text ( Text )
@@ -50,11 +52,11 @@ class DBType a => DBSemigroup a where
52instance Sql DBType a => DBSemigroup [a] where
54instance Sql DBType a => DBSemigroup [a] where
53− (<>.) = zipPrimExprsWith (Opaleye.BinExpr (Opaleye.:||))
55+ (<>.) = zipPrimExprsWith (Opaleye.BinExpr (Opaleye.:||) `on` toPrimArray)
56instance Sql DBType a => DBSemigroup (NonEmpty a) where
58instance Sql DBType a => DBSemigroup (NonEmpty a) where
57− (<>.) = zipPrimExprsWith (Opaleye.BinExpr (Opaleye.:||))
59+ (<>.) = zipPrimExprsWith (Opaleye.BinExpr (Opaleye.:||) `on` toPrimArray)
60instance DBSemigroup CalendarDiffTime where
62instance DBSemigroup CalendarDiffTime where