|
|
|
|
|
by zeptomu
2498 days ago
|
|
> [...] Idris is a lot more practical than I thought. This may sound like a stupid question (but is probably necessary in a thread about the convergence of proof systems and static typed functional programming languages): "How can i implement something like unix' wc?" So just a program that counts lines (forget words and bytes for now) of a file. This means we need to support (at least in some kind of standard library) basic IO stuff like files, processes and environments. If the language talks about how "simple" (in terms of code/term length) it is to define a binary tree ... the integers >= 0 (the famous Nat = Zero | Succ Nat) example, or beware the Fibonacci sequence - most people won't be impressed. Because that's what is associated with "programming language" (as compared to "proof assistents"). Sorry that sounds a bit like a rant, but after 5 minutes of searching I couldn't find an example how to read a file in Idris. The closest I found was: http://docs.idris-lang.org/en/latest/effects/impleff.html but it did not tell me how to open a file ... |
|