@@ -85,6 +85,7 @@ module Squeal.PostgreSQL.Schema
8585 -- * Aligned lists
8686 , AlignedList (..)
8787 , single
88+ , extractList
8889 -- * Data Definitions
8990 , Create
9091 , Drop
@@ -876,6 +877,11 @@ instance (forall t0 t1. RenderSQL (p t0 t1))
876877 step :>> Done -> renderSQL step
877878 step :>> steps -> renderSQL step <> ", " <> renderSQL steps
878879
880+extractList :: (forall a0 a1. p a0 a1 -> b) -> AlignedList p x0 x1 -> [b]
881+extractList f = \case
882+ Done -> []
883+ step :>> steps -> (f step):extractList f steps
884+
879885-- | A `single` step.
880886single :: p x0 x1 -> AlignedList p x0 x1
881887single step = step :>> Done