idris-hackers / software-foundations

Software Foundations in Idris
https://idris-hackers.github.io/software-foundations
MIT License
452 stars 34 forks source link

IndProp #26

Closed clayrat closed 7 years ago

clayrat commented 7 years ago

Feels like I'm stuck at filter_not_empty_In' here. First I construct Reflect using beq_natP {n} {m=x}, but when I try to match on it (either via case or with), I get (assuming the false case first):

Type mismatch between
        Reflect (n = x) False (Type of ReflectF notp)
and
        Reflect (n = x) (beq_nat n x) (Expected type)
clayrat commented 7 years ago

Ok, I think I've figured out the Reflect thing - it seems to work if you define it as

data Reflect : (p : Type) -> (b : Bool) -> Type where
  ReflectT : p -> (b=True) -> Reflect p b
  ReflectF : (Not p) -> (b=False) -> Reflect p b
clayrat commented 7 years ago

Ready for review

yurrriq commented 7 years ago

Thanks! I'll take a look today.

yurrriq commented 7 years ago

This is looking pretty good. I'm gonna merge it now and then PR some edits for you.