3 ms·
That's exactly what functional means. You're conflating functional and pure. They happen to be (essentially) the same thing in Haskell, but that's not always
by viscanti 14y ago
That's exactly what functional means. You're conflating functional and pure. They happen to be (essentially) the same thing in Haskell, but that's not always the case. A functional language can get you really close to pure (but good luck doing anything interesting without monads or mutable state), but even the purest languages cheat. Putting your side-effect code in a main function might help you catch bugs and limit potential side-effects, but it's still not completely pure (and for good reason, at the end of the day you actually want to do stuff).
- zopa 14y ago"Pure" is an adjective applied to "functional" so I don't see the conflation as odd. A language like JavaScript has first class functions, so it's a little bit functional. But no more than that, because most expressions aren't (mathematical) functions. Haskell is purely functional because everything's a function. (I/O primitives like getChar excepted, etc., etc.) Meanwhile, languages like Haskell don't cheat quite as much as you suggest. Monads are functions, and even in the IO Monad you're doing purely functional manipulation of IO primitives. Think of it as a purely functional funnel through which the dirty data of reality is poured.
- jacquesm 14y agoHe knows what it means. That's why there is a 'should' in that sentence. GP indicates that using functional in this manner is a poor choice.