Hacker News new | ask | show | jobs
by chii 1546 days ago
I guess they should describe FP as 'referentially transparent' or not.

Haskell is referentially transparent, but you can't say the same for many other FP languages like erlang, or ocaml.

1 comments

All the FP languages include a subset that is referentially transparent.

I do not consider the attempts of making the entire language referentially transparent and the exclusive use of lazy evaluation, like in Haskell, as being useful.

Obviously there are people who like these features and who use Haskell, but in any case whenever FP languages are mentioned they should not be reduced to those that have made the controversial Haskell choices.

I do believe that monads are what made it possible to be referentially transparent not for just a subset, but the entire language. It's a good choice - it enforces equational reasoning, even for things like IO and "side effects". It is harder to write code like this, if you're not used to it, but i imagine that if you can, the code would be of higher quality.