1 | module Deriving.SpecialiseData.Utils.Quantifiers
3 | import public Data.DPair
5 | import Data.List.Quantifiers
7 | import Data.Vect.Quantifiers
8 | import Data.SnocList.Quantifiers
13 | 0 snoc: All p prev -> p new -> All p (Data.Vect.snoc prev new)
15 | snoc (y :: ys) z = y :: snoc ys z
19 | fromListAll : (l : List t) -> (0 pr : All p l) => Subset (Vect (length l) t) (All p)
20 | fromListAll [] = Element [] []
21 | fromListAll (x :: xs) @{p :: ps} = do
22 | let Element xs' ps' = fromListAll xs @{ps}
23 | Element (x :: xs') (p :: ps')
28 | 0 snoc : All p prev -> p new -> All p (Data.List.snoc prev new)
30 | snoc (y :: ys) z = y :: snoc ys z
32 | namespace SnocListAll
35 | toListAll : (sl : SnocList t) -> (0 _ : All p sl) -> Subset (List t) (All p)
36 | toListAll [<] [<] = Element [] []
37 | toListAll (sx :< x) (sy :< y) = do
38 | let Element xs ys = toListAll sx sy
39 | Element (snoc xs x) (snoc ys y)