laughedelic/haskell-src-exts-qq — comment on commit e6920c42d56da765647882bcd2f8faf7418a8353
File:  line 0
By laughedelic:

This code demonstrates all three types of splicing:

``` haskell
qux = let f = Hs.name "foo" in [hs| \aa -> "xoo" |]
baz = let foo = Hs.name "boo"
x = Hs.name "a"
y = Hs.name "b"
in [dec| _foo _x (((y)):_x:[1]) = \_y z -> $(qux) |]
```

It will be transformed to (I mean `prettyPrint` form)

``` haskell
boo a (b : (a : [1])) = \ b z -> \ aa -> "xoo"
```

So, we use three forms of splicing:

* `$(foo)` TH-syntax for splicing expressions in expressions
* `((foo))` for splicing of names patterns or expressions
* `_foo` for splicing of names patterns, expression and names of declarations.