|
|
|
|
|
by dwohnitmok
1204 days ago
|
|
Without dependent types you can't do your common constraints in an order independent way. You end up with four choices: 1. Have a single function that does all the constraint checking at once 2. Have a single linear order where each constraint check feeds into the next but only in that order 3. Acquiesce to a combinatorial explosion of functions that check every possible combination of those constraints 4. Give up keeping track of the constraints at a type level. |
|
(But I'm not expert, admittedly, and I isn't an actual problem of much consequence in practical programming in Haskell or Scala. Opaque types do the 80% bit of 80-20 just fine.)