[Haskell-cafe] Template Haskell question
kai.prott at hotmail.de
Tue Apr 27 14:06:27 UTC 2021
what is the reasoning behind the behavior of the following two Haskell
ghci> :set -XTemplateHaskell
ghci> let f x ($([p| x |])) = x in f 1 2
ghci> let f ($([p| x |])) x = x in f 1 2
I'd have guessed that they should both fail compilation with
"Conflicting definitions for ‘x’" like the following expression.
ghci> let f x x = x in f 1 2
Moreover, it seems odd that the "x" on the right side always refers to
the rightmost pattern variable "x" (regardless if quoted or not).
More information about the Haskell-Cafe