on dev help sign in
NP concat
commit2bf8f377add8150723448748fb6c72bf848ead22 authorEitan Chatav <eitan@Eitans-MacBook-Pro.local> dateFri 29 Mar 2019, 15:20 (8 years ago) parent1825ffc
1 file changed+9
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+9
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+9
@@ -94,6 +94,7 @@ module Squeal.PostgreSQL.Schema
9494 , In
9595 , Length
9696 , (*:)
97+ , (+++)
9798 -- * Type Classifications
9899 , HasOid (..)
99100 , PGNum
@@ -769,3 +770,11 @@ single step = step :>> Done
769770-- | A useful operator for ending an `NP` list of length at least 2 without `Nil`.
770771(*:) :: f x -> f y -> NP f '[x,y]
771772x *: 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 +++