@@ -24,11 +24,10 @@ import Prelude
2424-- rel8
2525import Rel8.Expr ( Expr, Col(..) )
2626import Rel8.Expr.Array ( sappend1, snonEmptyOf )
27−import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
2827import Rel8.Schema.Dict ( Dict( Dict ) )
2928import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
3029import Rel8.Schema.HTable.Vectorize ( happend, hvectorize )
31−import Rel8.Schema.Insert ( Col( OptionalInsert, RequiredInsert ), Insert )
30+import Rel8.Schema.Insert ( Inserts )
3231import Rel8.Schema.Name ( Col( NameCol ), Name )
3332import Rel8.Schema.Null ( Nullity( Null, NotNull ) )
3433import Rel8.Schema.Reify ( hreify, hunreify )
@@ -40,6 +39,7 @@ import Rel8.Table
4039 )
4140import Rel8.Table.Alternative ( AltTable, (<|>:) )
4241import Rel8.Table.Eq ( EqTable, eqTable )
42+import Rel8.Table.Insert ( toInsert )
4343import Rel8.Table.Ord ( OrdTable, ordTable )
4444import Rel8.Table.Recontextualize ( Recontextualize )
4545import Rel8.Table.Serialize ( FromExprs, ToExprs, fromResult, toResult )
@@ -118,13 +118,9 @@ nonEmptyTable =
118118 fmap toColumns
119119
120120
121−insertNonEmptyTable :: Table Insert a => NonEmpty a -> NonEmptyTable a
122−insertNonEmptyTable =
123− NonEmptyTable .
124− hvectorize (\SSpec {necessity, info} -> case necessity of
125− SRequired -> RequiredInsert . snonEmptyOf info . fmap (\(RequiredInsert a) -> a)
126− SOptional -> OptionalInsert . fmap (snonEmptyOf info) . traverse (\(OptionalInsert a) -> a)) .
127− fmap toColumns
121+insertNonEmptyTable :: Inserts exprs inserts
122+ => NonEmpty exprs -> NonEmptyTable inserts
123+insertNonEmptyTable = toInsert . nonEmptyTable
128124
129125
130126nameNonEmptyTable :: Table Name a => a -> NonEmptyTable a