
27 Apr
2021
27 Apr
'21
10:06 a.m.
Dear Cafe, what is the reasoning behind the behavior of the following two Haskell expressions: ghci> :set -XTemplateHaskell ghci> let f x ($([p| x |])) = x in f 1 2 2 ghci> let f ($([p| x |])) x = x in f 1 2 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 error: ... Moreover, it seems odd that the "x" on the right side always refers to the rightmost pattern variable "x" (regardless if quoted or not). Cheers, Kai