OpShin/opshin-pioneer-program

Idea: More intuitive use of contains

nielstron opened this issue · 1 comments

The contains method might be a bit unintuitive for the average user, I.e. in this line

https://github.com/OpShin/eopsin-pioneer-program/blob/9ca00959579e25688191f6e6901225cdc6c489ca/src/week03/lecture/parameterized_vesting.py#L17

I suggest to add this to interval and use it instead

def is_after(x, y):
   # True iff y is after x
   return contains(make_from(x, TrueData()), y)

The parameters could also be switched. Still thinking about a clearer/less confusing/confusable name for the relationship

I agree this can be a bit confusing. I think we would need to make clear that the block slot is the interval is after the deadline. I think your snippet achieves that mostly. The lecture goes into why that must be the case but isn't clear from the code. As a result I made a mistake implementing it before watching the lecture. I'll think about this more...