Zulip Chat Archive

Stream: lean4

Topic: generalizing ranges?


Alok Singh (Jan 08 2024 at 09:39):

rust and haskell have some typeclasses for ranges. the [start:stop:step] syntax only supports nats.

James Gallicchio (Jan 09 2024 at 04:47):

I have done some work generalizing from ranges to arbitrary sequences of elements, and it would be pretty straightforward to generalize what I have to any linearly ordered type with addition.

This could be useful for providing ranges on UIntX and USize without too much code duplication. I'll look into it!


Last updated: May 02 2025 at 03:31 UTC