[Template-haskell] Non-typechecked reification brackets

Ian Lynagh igloo@earth.li
Tue, 8 Apr 2003 12:45:18 +0100


Hi all,

I've just (locally) added a [| ... |n] style of reification brackets
that aren't type checked. This means I can do things like

    [| \g x y -> Tup (Cond g x y) --> Cond g (Tup x) (Tup y) |n]

for describing rewrite rules (they end up being correctly typed when
I've fiddled about with them). I think I've worked around cases where
I'd wanted to do this but couldn't in the past, but where I had a
simpler alternative; I didn't keep a note of them unfortunately. This
has a very small impact on the code - just add a Bool to ExpBr (and the
others) "data HsBracket id = ExpBr (HsExpr id) Bool" and then alter the
handful of places it's used.

My question is, is this an appropriate thing to be in Template Haskell?
I for one would find it useful.


Thanks
Ian