mirror of
https://github.com/ilyakooo0/squeal.git
synced 2024-09-11 13:57:29 +03:00
remove dead code
This commit is contained in:
parent
af3bcfc01d
commit
079a4290c5
@ -75,43 +75,7 @@ instance Additional (NP expr) where
|
||||
also ys = \case
|
||||
Nil -> ys
|
||||
x :* xs -> x :* (xs & also ys)
|
||||
{-
|
||||
-- | An `AlignedList` is a type-aligned list or free category.
|
||||
data AlignedList p x0 x1 where
|
||||
Done :: AlignedList p x x
|
||||
(:>>) :: p x0 x1 -> AlignedList p x1 x2 -> AlignedList p x0 x2
|
||||
infixr 7 :>>
|
||||
instance Category (AlignedList p) where
|
||||
id = Done
|
||||
(.) list = \case
|
||||
Done -> list
|
||||
step :>> steps -> step :>> (steps >>> list)
|
||||
instance (forall t0 t1. RenderSQL (p t0 t1))
|
||||
=> RenderSQL (AlignedList p x0 x1) where
|
||||
renderSQL = \case
|
||||
Done -> ""
|
||||
step :>> Done -> renderSQL step
|
||||
step :>> steps -> renderSQL step <> ", " <> renderSQL steps
|
||||
|
||||
-- | `extractList` turns an `AlignedList` into a standard list.
|
||||
extractList :: (forall a0 a1. p a0 a1 -> b) -> AlignedList p x0 x1 -> [b]
|
||||
extractList f = \case
|
||||
Done -> []
|
||||
step :>> steps -> (f step):extractList f steps
|
||||
|
||||
-- | `mapAligned` applies a function to each element of an `AlignedList`.
|
||||
mapAligned
|
||||
:: (forall z0 z1. p z0 z1 -> q z0 z1)
|
||||
-> AlignedList p x0 x1
|
||||
-> AlignedList q x0 x1
|
||||
mapAligned f = \case
|
||||
Done -> Done
|
||||
x :>> xs -> f x :>> mapAligned f xs
|
||||
|
||||
-- | A `single` step.
|
||||
single :: p x0 x1 -> AlignedList p x0 x1
|
||||
single step = step :>> Done
|
||||
-}
|
||||
-- | A useful operator for ending an `NP` list of length at least 2 without `Nil`.
|
||||
(*:) :: f x -> f y -> NP f '[x,y]
|
||||
x *: y = x :* y :* Nil
|
||||
|
Loading…
Reference in New Issue
Block a user