on dev help sign in
NP concat
2bf8f37Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+9
@@ -94,6 +94,7 @@ module Squeal.PostgreSQL.Schema
94 , In
94 , In
95 , Length
95 , Length
96 , (*:)
96 , (*:)
97+ , (+++)
97 -- * Type Classifications
98 -- * Type Classifications
98 , HasOid (..)
99 , HasOid (..)
99 , PGNum
100 , PGNum
@@ -769,3 +770,11 @@ single step = step :>> Done
769-- | A useful operator for ending an `NP` list of length at least 2 without `Nil`.
770-- | A useful operator for ending an `NP` list of length at least 2 without `Nil`.
770(*:) :: f x -> f y -> NP f '[x,y]
771(*:) :: f x -> f y -> NP f '[x,y]
771x *: y = x :* y :* Nil
772x *: y = x :* y :* Nil
773+infixl 9 *:
774+
775+-- | Concatenate `NP` lists.
776+(+++) :: NP f xs -> NP f ys -> NP f (Join xs ys)
777+xs +++ ys = case xs of
778+ Nil -> ys
779+ x :* xs' -> x :* (xs' +++ ys)
780+infixr 5 +++