@@ -134,17 +134,15 @@ instance ListContext Name where
134134 where rename = N . (\ (Name x) -> Name x) . unN
135135
136136
137- instance (Table context a , c ~ context , Context a ~ c , ListContext context ) =>
138- Table context (ListTable c a )
137+ instance (Table context a , context ~ context' , ListContext context' ) =>
138+ Table context' (ListTable context a )
139139 where
140- type Columns (ListTable c a ) = HListTable (Columns a )
141- type Context (ListTable c a ) = Context a
142- type FromExprs (ListTable c a ) = [FromExprs a ]
143-
144- fromColumns c = ListTable fromColumns c
140+ type Columns (ListTable context a ) = HListTable (Columns a )
141+ type Context (ListTable context a ) = Context a
142+ type FromExprs (ListTable context a ) = [FromExprs a ]
145143
144+ fromColumns = ListTable fromColumns
146145 toColumns (ListTable f cols) = mapColumns (toColumns . f) cols
147-
148146 fromResult = fmap (fromResult @ _ @ a ) . hunvectorize unvectorizer
149147 toResult = hvectorize vectorizer . fmap (toResult @ _ @ a )
150148
@@ -171,7 +169,8 @@ instance (OrdTable a, context ~ Expr) => OrdTable (ListTable context a) where
171169 (Identity (ordTable @ a ))
172170
173171
174- instance (context ~ Expr , ToExprs exprs a ) => ToExprs (ListTable context exprs ) [a ] where
172+ instance (ToExprs exprs a , context ~ Expr ) =>
173+ ToExprs (ListTable context exprs ) [a ]
175174
176175
177176instance context ~ Expr => AltTable (ListTable context ) where
@@ -182,19 +181,23 @@ instance context ~ Expr => AlternativeTable (ListTable context) where
182181 emptyTable = mempty
183182
184183
185- instance (context ~ Expr , Table Expr a ) => Semigroup (ListTable context a ) where
186- as <> bs = ListTable fromColumns $
184+ instance (context ~ Expr , Table Expr a ) =>
185+ Semigroup (ListTable context a )
186+ where
187+ as <> bs = fromColumns $
187188 happend (\ _ _ (E a) (E b) -> E (sappend a b)) (toColumns as) (toColumns bs)
188189
189190
190- instance (context ~ Expr , Table Expr a ) => Monoid (ListTable context a ) where
191- mempty = ListTable fromColumns $ hempty $ \ _ -> E . sempty
191+ instance (context ~ Expr , Table Expr a ) =>
192+ Monoid (ListTable context a )
193+ where
194+ mempty = fromColumns $ hempty $ \ _ -> E . sempty
192195
193196
194197-- | Construct a @ListTable@ from a list of expressions.
195198listTable :: Table Expr a => [a ] -> ListTable Expr a
196199listTable =
197- ListTable fromColumns .
200+ fromColumns .
198201 hvectorize (\ SSpec {info} -> E . slistOf info . fmap unE) .
199202 fmap toColumns
200203
@@ -207,7 +210,7 @@ nameListTable
207210 => a -- ^ The names of the columns of elements of the list.
208211 -> ListTable Name a
209212nameListTable =
210- ListTable fromColumns .
213+ fromColumns .
211214 hvectorize (\ _ (Identity (N (Name a))) -> N (Name a)) .
212215 pure .
213216 toColumns
0 commit comments