From: Joel Burget <joelburget@gmail.com>
Subject: [Haskell-cafe] Assimp FFI Library
To: haskell-cafe@haskell.org
Message-ID: <BANLkTimW-71NcBRqnr68kRAvKZytE1uVwA@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
5. I've reduced a lot of boilerplate in Vec.hs by using the CPP preprocessor
extension. I could reduce the boilerplate by another factor of 3 if I could
recursively call templates but that's not allowed. I would like to have one
template to generate both of these lines:
> data Vec N2 Double t = Vec2D !Double !Double deriving (Show, Eq)
> data Vec N3 Double t = Vec3D !Double !Double !Double deriving (Show, Eq)
Notice there is an extra !Double in the second. Is there an easy way to do
this? I don't know much about Template Haskell, would that work? Would it be
easy?