@@ -60,16 +60,28 @@ ident' β· β t f. Corecursive t (Sig.SqlF f) β Sig.Ident β t
6060ident' = embed β Sig.Identifier
6161
6262match β· β t f . Corecursive t (Sig.SqlF f ) β t β L.List (Sig.Case t ) β Maybe t β t
63- match expr cases else_ = embed $ Sig.Match { expr, cases, else_ }
63+ match expr cases else_ = match' { expr, cases, else_ }
64+
65+ match' β· β t f . Corecursive t (Sig.SqlF f ) β Sig.MatchR t β t
66+ match' = embed β Sig.Match
6467
6568switch β· β t f . Corecursive t (Sig.SqlF f ) β L.List (Sig.Case t ) β Maybe t β t
66- switch cases else_ = embed $ Sig.Switch { cases, else_ }
69+ switch cases else_ = switch' { cases, else_ }
70+
71+ switch' β· β t f . Corecursive t (Sig.SqlF f ) β Sig.SwitchR t β t
72+ switch' = embed β Sig.Switch
6773
6874let_ β· β t f . Corecursive t (Sig.SqlF f ) β Sig.Ident β t β t β t
6975let_ id bindTo in_ = embed $ Sig.Let { ident: id, bindTo, in_ }
7076
77+ let' β· β t f . Corecursive t (Sig.SqlF f ) β Sig.LetR t β t
78+ let' = embed β Sig.Let
79+
7180invokeFunction β· β t f . Corecursive t (Sig.SqlF f ) β Sig.Ident β L.List t β t
72- invokeFunction name args = embed $ Sig.InvokeFunction {name, args}
81+ invokeFunction name args = invokeFunction' { name, args }
82+
83+ invokeFunction' β· β t f . Corecursive t (Sig.SqlF f ) β Sig.InvokeFunctionR t β t
84+ invokeFunction' = embed β Sig.InvokeFunction
7385
7486-- when (bool true) # then_ (num 1.0) :P
7587when β· β t . t β (t β Sig.Case t )
@@ -90,8 +102,7 @@ select
90102 β Maybe (Sig.OrderBy t )
91103 β t
92104select isDistinct projections relations filter gb orderBy =
93- embed
94- $ Sig.Select
105+ select'
95106 { isDistinct
96107 , projections: L .fromFoldable projections
97108 , relations
@@ -100,6 +111,8 @@ select isDistinct projections relations filter gb orderBy =
100111 , orderBy
101112 }
102113
114+ select' β· β t f . Corecursive t (Sig.SqlF f ) β Sig.SelectR t β t
115+ select' = embed β Sig.Select
103116
104117-- project (ident "foo") # as "bar"
105118-- project (ident "foo")
@@ -120,9 +133,8 @@ having t (Sig.GroupBy r) = Sig.GroupBy r{ having = Just t }
120133
121134buildSelect β· β t f . Corecursive t (Sig.SqlF f ) β (Sig.SelectR t β Sig.SelectR t ) β t
122135buildSelect f =
123- embed
124- $ Sig.Select
125- $ f { isDistinct: false
136+ select' $
137+ f { isDistinct: false
126138 , projections: L.Nil
127139 , relations: Nothing
128140 , filter: Nothing
0 commit comments