Last active
July 7, 2019 14:12
-
-
Save dckc/19753bd4a528d86a3deef39b2ac7415e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<clayrat> dckc-ho, rewrite doesn't work on case expressions, it's a known old bug | |
<clayrat> https://github.com/idris-lang/Idris-dev/issues/4001 | |
<clayrat> if you define lookup via `with` then that line in the proof is simply `rewrite decEqSelfIsYes {x=key} in Refl` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Notation | |
lookup' : DecEq k => (key: k) -> (dict: List (k, v)) -> Maybe v | |
lookup' key [] = Nothing | |
lookup' key ((k0, v0) :: rest) with (decEq key k0) | |
| Yes _ = Just v0 | |
| No _ = (lookup' key rest) | |
add_1: DecEq k => (key: k) -> (val: v) -> (dict: List (k, v)) | |
-> (lookup' key ((key, val) :: dict)) = (Just val) | |
add_1 key val [] = | |
rewrite (decEqSelfIsYes {x=key}) in Refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment