Template Haskell...

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Wed Oct 29 21:20:17 EST 2003

> Okay, I have got my template working, but its extremely unreadable... could
> anyone tell me how to make this look more like normal Haskell code?

Write some combinators for the more common patterns.
Some example patterns are:

  T1 -> ... -> Tn
  (T1, ... Tn)
  TC T1 ... Tn

  \ x1 ... xn -> ...
  let x = e in ...
  case e of { (x1,...xn) -> ... }
  f e1 ... en

I posted some (in the hope that they'd make it into a standard library) here:


And, of course, the TH library includes some (but not enough).

Alastair Reid    www.haskell-consulting.com

More information about the Glasgow-haskell-users mailing list