diff options
author | Helmut Grohne <helmut@subdivi.de> | 2012-10-05 10:58:15 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2012-10-05 10:58:15 +0200 |
commit | 96e45ecbf31c5685fa914882ec4b21b1392c49fc (patch) | |
tree | 361c0c2ece69db38604b874f20cb93a7e68507c0 | |
parent | caeae59c7e6ae461a066ac008160035dbff9122b (diff) | |
download | bidiragda-96e45ecbf31c5685fa914882ec4b21b1392c49fc.tar.gz |
remove VecRevBFF
The case is not interesting, because it is too restricted. The defined
get-type requires a bijection between input length and output length.
Since it requires polymorphism we get a reverse get-len via free
theorems and both compositions are required to be identities. Thus the
case is restricted without providing new insights.
-rw-r--r-- | BFF.agda | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -58,24 +58,3 @@ module VecBFF where h = assoc eq (get s′) v h′ = fmap (flip union g) h in fmap (flip mapV s′ ∘ flip lookupV) h′ - -module VecRevBFF where - get-type : (ℕ → ℕ) → Set₁ - get-type getlen = {A : Set} {n : ℕ} → Vec A (getlen n) → Vec A n - - assoc : {A : Set} {m n : ℕ} → EqInst A → Vec (Fin m) n → Vec A n → Maybe (FinMapMaybe m A) - assoc _ []V []V = just empty - assoc eq (i ∷V is) (b ∷V bs) = (assoc eq is bs) >>= (checkInsert eq i b) - - enumerate : {A : Set} {n : ℕ} → Vec A n → Vec (Fin n) n - enumerate _ = tabulate id - - denumerate : {A : Set} {n : ℕ} → Vec A n → Fin n → A - denumerate = flip lookupV - - bff : {getlen : ℕ → ℕ} → (get-type getlen) → ({m : ℕ} {B : Set} → EqInst B → Vec B (getlen m) → Vec B m → Maybe (Vec B (getlen m))) - bff get eq s v = let s′ = enumerate s - g = fromFunc (denumerate s) - h = assoc eq (get s′) v - h′ = fmap (flip union g) h - in fmap (flip mapV s′ ∘ (flip lookup)) h′ |