|
|
|
|
|
by Warwolt
1347 days ago
|
|
One really nice "everyday" example that comes from Idris that I really like is the ability to typecheck a printf function. You provide the format string, and then the typechecker will know what to expect from the rest of the arguments! Usually that is implemented in C compilers, so that "printf("%d", 2.3f)" becomes an error, but with dependent types you can do it on the user level in library code. |
|
https://github.com/mukeshtiwari/Idris/blob/master/Printf.idr