2 ms·
Firstly, I'm not sure you can even write that in Template Haskell. The syntax would actually be let a = 2 in $(m a) and since `a` is not in scope at the
by tome 5y ago
Firstly, I'm not sure you can even write that in Template Haskell. The syntax would actually be
let a = 2 in $(m a)
and since `a` is not in scope at the time the TH splice runs compilation will fail. Secondly, even if you could write it, I don't really think something that contains Template Haskell should be called a "Haskell expression".
With regard to pron's comment, he has a long history of being technically correct with regard to Haskell. The operative point is
> What they mean is that the language is referentially transparent (like most language) and a term's reference (denotation) is an object value in the language
i.e. Haskell is referentially transparent with respect to a particularly coarse semantics (value semantics).
Anyway, your greater point that referential transparency doesn't imply immutability is completely correct.