diff options
author | Helmut Grohne <helmut@subdivi.de> | 2012-01-22 23:11:19 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2012-01-22 23:11:19 +0100 |
commit | 6e3b0445d0c7a412f1dde5d9abf9e97b26e1cfe8 (patch) | |
tree | d9a6a16bfaf9feab7c7ac4709e054cb95a63de61 /Bidir.agda | |
parent | 8ad3dfdcba5a664850f3451d4b89634efcc3fd25 (diff) | |
download | bidiragda-6e3b0445d0c7a412f1dde5d9abf9e97b26e1cfe8.tar.gz |
actually fmap is what I meant instead of >>=
Diffstat (limited to 'Bidir.agda')
-rw-r--r-- | Bidir.agda | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -15,6 +15,9 @@ open import Relation.Binary.PropositionalEquality _>>=_ : {A B : Set} → Maybe A → (A → Maybe B) → Maybe B _>>=_ = flip (flip maybe′ nothing) +fmap : {A B : Set} → (A → B) → Maybe A → Maybe B +fmap f = maybe′ (λ a → just (f a)) nothing + module FinMap where FinMapMaybe : â„• → Set → Set @@ -96,8 +99,8 @@ bff : ({A : Set} → List A → List A) → ({B : Set} → EqInst B → List B â bff get eq s v = let s′ = idrange (length s) g = fromFunc (λ f → lookupVec f (fromList s)) h = assoc eq (get s′) v - h′ = h >>= (λ jh → just (union jh g)) - in h′ >>= (λ jh′ → just (map (flip lookup jh′) s′)) + h′ = fmap (flip union g) h + in fmap (flip map s′ ∘ flip lookup) h′ theorem-1 : (get : {α : Set} → List α → List α) → {Ï„ : Set} → (eq : EqInst Ï„) → (s : List Ï„) → bff get eq s (get s) ≡ just s theorem-1 get eq s = {!!} |