summaryrefslogtreecommitdiff
path: root/Bidir.agda
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2012-01-31 18:32:46 +0100
committerHelmut Grohne <helmut@subdivi.de>2012-01-31 18:32:46 +0100
commit8e841d13a36cc57300a3fe4eec5305b684212e60 (patch)
tree2f8cebdba6c2b4ecbb6d9804a7acd20e96dacf34 /Bidir.agda
parentc62e107155b8fea28dbf1637f9187e4f24f75173 (diff)
downloadbidiragda-8e841d13a36cc57300a3fe4eec5305b684212e60.tar.gz
replace idrange with enumerate
Looks like uses of idrange would always be passed a length, so move it inside the definition.
Diffstat (limited to 'Bidir.agda')
-rw-r--r--Bidir.agda6
1 files changed, 3 insertions, 3 deletions
diff --git a/Bidir.agda b/Bidir.agda
index 81f00dd..15a389c 100644
--- a/Bidir.agda
+++ b/Bidir.agda
@@ -93,11 +93,11 @@ lemma-2 eq (i ∷ is) (x ∷ xs) h p | just h' | Reveal_is_.[_] ir = begin
≡⟨ refl ⟩
map just (x ∷ xs) ∎
-idrange : (n : ℕ) → List (Fin n)
-idrange n = toList (tabulate id)
+enumerate : {A : Set} → (l : List A) → List (Fin (length l))
+enumerate l = toList (tabulate id)
bff : ({A : Set} → List A → List A) → ({B : Set} → EqInst B → List B → List B → Maybe (List B))
-bff get eq s v = let s′ = idrange (length s)
+bff get eq s v = let s′ = enumerate s
g = fromFunc (λ f → lookupVec f (fromList s))
h = assoc eq (get s′) v
h′ = fmap (flip union g) h