on dev help sign in
remove dead code
commit079a4290c527b095a4a7f2ee1981fd33d8e50f7a authorEitan Chatav <eitan@EEM109LMBP-1.local> dateMon 16 Sep 2019, 20:17 (7 years ago) parentaf3bcfc
1 file changed−36
squeal-postgresql/src/Squeal/PostgreSQL/List.hs−36
squeal-postgresql/src/Squeal/PostgreSQL/List.hs−36
@@ -75,43 +75,7 @@ instance Additional (NP expr) where
7575 also ys = \case
7676 Nil -> ys
7777 x :* xs -> x :* (xs & also ys)
78−{-
79−-- | An `AlignedList` is a type-aligned list or free category.
80−data AlignedList p x0 x1 where
81− Done :: AlignedList p x x
82− (:>>) :: p x0 x1 -> AlignedList p x1 x2 -> AlignedList p x0 x2
83−infixr 7 :>>
84−instance Category (AlignedList p) where
85− id = Done
86− (.) list = \case
87− Done -> list
88− step :>> steps -> step :>> (steps >>> list)
89−instance (forall t0 t1. RenderSQL (p t0 t1))
90− => RenderSQL (AlignedList p x0 x1) where
91− renderSQL = \case
92− Done -> ""
93− step :>> Done -> renderSQL step
94− step :>> steps -> renderSQL step <> ", " <> renderSQL steps
9578
96−-- | `extractList` turns an `AlignedList` into a standard list.
97−extractList :: (forall a0 a1. p a0 a1 -> b) -> AlignedList p x0 x1 -> [b]
98−extractList f = \case
99− Done -> []
100− step :>> steps -> (f step):extractList f steps
101−
102−-- | `mapAligned` applies a function to each element of an `AlignedList`.
103−mapAligned
104− :: (forall z0 z1. p z0 z1 -> q z0 z1)
105− -> AlignedList p x0 x1
106− -> AlignedList q x0 x1
107−mapAligned f = \case
108− Done -> Done
109− x :>> xs -> f x :>> mapAligned f xs
110−
111−-- | A `single` step.
112−single :: p x0 x1 -> AlignedList p x0 x1
113−single step = step :>> Done
114−-}
11579-- | A useful operator for ending an `NP` list of length at least 2 without `Nil`.
11680(*:) :: f x -> f y -> NP f '[x,y]
11781x *: y = x :* y :* Nil