|
|
|
|
|
by lomnakkus
3822 days ago
|
|
I believe the Idris runtime uses erasure rather than code generation[1]. The key here is that Idris will make call sites prove statically that the conditions hold, either through having static conditions of their own or proving that the programmer has checked (at runtime) that the conditions hold. (This case of append-n-to-m-vector is a bit weird since it basically just amounts to calculating the length of the output, but my previous statement applies a bit more generally.) [1] So one plausible representation for Vec n a would be a size + array of pointers to a's. I believe they're actually using linked list for Vec at the moment, though. |
|
I would be curious to see an Idris program that reads two vectors out of some file (without knowing the size a priori) and concatenates them