@@ -11,7 +11,9 @@
1111
1212module Rel8.Table.NonEmpty
1313 ( NonEmptyTable(..)
14− , nonEmptyTable, nameNonEmptyTable
14+ , ($+)
15+ , nonEmptyTable
16+ , nameNonEmptyTable
1517 )
1618where
1719
@@ -29,7 +31,7 @@ import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
2931import Rel8.Schema.HTable.Vectorize
3032 ( hvectorize, hunvectorize
3133 , happend
32− , hproject
34+ , hproject, hcolumn
3335 )
3436import qualified Rel8.Schema.Kind as K
3537import Rel8.Schema.Name ( Name( Name ) )
@@ -44,7 +46,9 @@ import Rel8.Table
4446import Rel8.Table.Alternative ( AltTable, (<|>:) )
4547import Rel8.Table.Eq ( EqTable, eqTable )
4648import Rel8.Table.Ord ( OrdTable, ordTable )
47−import Rel8.Table.Projection ( Projectable, project, apply )
49+import Rel8.Table.Projection
50+ ( Projectable, Projecting, Projection, project, apply
51+ )
4852import Rel8.Table.Serialize ( ToExprs )
4953
5054
@@ -110,6 +114,13 @@ instance (Table Expr a, context ~ Expr) => Semigroup (NonEmptyTable context a)
110114 happend (const sappend1) as bs
111115
112116
117+-- | Project a single expression out of a 'NonEmptyTable'.
118+($+) :: Projecting a (Expr b)
119+ => Projection a (Expr b) -> NonEmptyTable Expr a -> Expr (NonEmpty b)
120+f $+ NonEmptyTable a = hcolumn $ hproject (apply f) a
121+infixl 4 $+
122+
123+
113124-- | Construct a @NonEmptyTable@ from a non-empty list of expressions.
114125nonEmptyTable :: Table Expr a => NonEmpty a -> NonEmptyTable Expr a
115126nonEmptyTable =