News for hackers. Stuff that matters.
Re:N-queen puzzle in 4 lines of Scala by willtim on Sunday April 10, 2016 @05:47PM (#11468330)
There is no well defined definition of functional programming. Since almost every mainstream imperative language supports higher-order functions, I would suggest that criteria is inadequate. A better definition is programming without side-effects.
Re:N-queen puzzle in 4 lines of Scala by rwjwjuwjudf on Sunday April 10, 2016 @05:57PM (#11468369)
Output is a side effect.
Re:N-queen puzzle in 4 lines of Scala by willtim on Sunday April 10, 2016 @06:03PM (#11468391)
Not in Haskell and other pure languages. Pure functional programming is used to construct larger programs from smaller ones, which only when finally executed by the runtime produce output.
Re:N-queen puzzle in 4 lines of Scala by rwjwjuwjudf on Sunday April 10, 2016 @06:16PM (#11468438)
Are there any programs that produce output before they are executed?
Re:N-queen puzzle in 4 lines of Scala by willtim on Monday April 11, 2016 @01:57AM (#11469876)
It is not easy describing pure functional programming in two sentences. I encourage you to read up on it yourself. Again, IO is not a side-effect in pure languages such as Haskell. And again, the absence of side-effects best defines functional programming, not any particular feature, which imperative languages can and do steal.