4 ms·
Sum types don't automatically define ordering between the possible values AFAIK? So in your implementation you'd have to manually define the up: (regular |
by ajuc 4y ago
Sum types don't automatically define ordering between the possible values AFAIK? So in your implementation you'd have to manually define the
up: (regular | lobby | parking) -> (regular | lobby | parking)
down: (regular | lobby | parking) -> (regular | lobby | parking)
and
which_way: (regular | lobby | parking) x (regular | lobby | parking) -> direction
If you use subset of integers you can just use operators inc, dec and <.
Yeah I know it was a joke.
- adrianmonk 4y agoIf I build a building in the shape of a double helix, what order are the two floors in? Hmm, are there actually an infinite number of floors? Do we need to switch to floating point?
- ajuc 4y ago> If I build a building in the shape of a double helix, what order are the two floors in? Why separate the floors that are on the same level? > Hmm, are there actually an infinite number of floors? I assumed there isn't and that we use a subset of integers. If you have infinite number of floors - feel free to use full set of integers (if you have enough memory that is). > Do we need to switch to floating point? No point, if you have more than aleph0 floors - floats won't help you.