Re:Why functional programming matters (1990) [pdf]
by lmm on Thursday May 07, 2015 @05:53AM
(#9504009)
Is purity dead? Do you consider Idris a theorem prover? It's dependently typed but seems to be designed for writing operational programs rather than proofs.
[ Parent
| on HN ]
Re:Why functional programming matters (1990) [pdf]
by mafribe on Thursday May 07, 2015 @06:00AM
(#9504023)
I'm not familiar enough with Idris to know exactly how state is handled, but yes, Idris is a prover, since it has dependent types.
If you want to verify your programs (and in 99.9% of programs you probably don't as you get it sufficiently correct by more lightweight techniques such as testing and code-reviews), then purity is fine, since you have to track effects explicitly anyway to prove non-trivial results, and doing this in a pure functional way or say with auxiliary variables in a Hoare-logic are kind-of/sort-of notational variants.
Re:Why functional programming matters (1990) [pdf]
by efnx on Tuesday May 12, 2015 @12:27PM
(#9532868)
Dependent types aren't only useful in languages that prove theorems, so I think a better qualification for "provers" might be termination checking.
Re:Why functional programming matters (1990) [pdf]
by lmm on Thursday May 07, 2015 @11:33AM
(#9505790)
If "prover" just means "has dependent types" then that's a much larger class than it sounds like. I write a lot of Scala, which has dependent types, but most of the code I write is just ordinary web services.
Re:Why functional programming matters (1990) [pdf]
by mafribe on Friday May 08, 2015 @01:44AM
(#9510158)
I meant dependent types a la Agda, Coq etc that you can use for proving essentially arbitrary properties. Scala and Haskell do not have this.