T5971.hs:6:7: The exact Name `x' is not in scope Probable cause: you used a unique Template Haskell name (NameU), perhaps via newName, but did not bind it If that's it, then -ddump-splices might be useful In the result of the splice: $(newName "x" >>= varE) To see what the splice expanded to, use -ddump-splices In the expression: $(newName "x" >>= varE) In a pattern binding: _ = $(newName "x" >>= varE)