Zulip Chat Archive

Stream: general

Topic: How to choose between prop and type/view ?


Henrik Böving (Dec 26 2022 at 15:15):

We would usually define Palindrom as List a -> Prop and if you want to use the fact that some list is a palindrom use a Subtype

Trebor Huang (Dec 26 2022 at 15:48):

The more Lean-y way is to use something like

inductive View (l : List a) : Type where
  even : (half : List a) ... l is made from half ... -> View l
  odd : ... similar

Trebor Huang (Dec 26 2022 at 15:49):

This way actually more code is reused, and the Idris style views are less beneficial because we have powerful automation.

Trebor Huang (Dec 26 2022 at 15:50):

You can see the same style difference just from how we define Fin.


Last updated: Dec 20 2023 at 11:08 UTC