|
|
|
|
|
by MrManatee
3947 days ago
|
|
I have sometimes wondered whether it would be useful to have two different types for indices, depending on if we are indexing the elements themselves or the "gaps" between them. Let's say I'm thinking about some language like Haskell, where types are already a big deal. That way the compiler would be able to tell if I accidentally mixed the two. Every conversion would have to explicit: for example, there might be two functions, "before" and "after", that take a gap index, and return an element index. I think I might actually enjoy programming this way, but perhaps others would find it needlessly bureaucratic. |
|