[Haskell-cafe] haskell-src-meta Package

George Giorgidze ggg at cs.nott.ac.uk
Wed Jan 21 12:53:31 EST 2009


In my project I needed a function that would parse a string into a
template-haskell AST representing the Haskell expression. To be more
precise I needed a function with the following type signature.

:: String -> Either String Language.Haskell.TH.Syntax.Exp

This kind of function should exist in the implementation of
template-haskell, however it is not exported for public consumption
from template-haskell package.

There is haskell-src-exts package that provides a Haskell expression
parser however it uses its own Exp data type which differs from the
template haskell representation Exp.

After that, I found haskell-src-meta package that provided the
function I needed:

parseExp :: String -> Either String TH.Exp

This function uses parser from  haskell-src-exts package and after
that translates returned Exp representation into the template-haskell
representation of Exp.

So problem has been solved. However, In the light of recent changes
and enhancements in the haskell-src-exts, haskell-src-meta package on
Hackage is broken. I have fixed the broken package and contacted its
author and maintainer (Matt Morrow). However, he did not reply.

I have a number of questions:

Was the use of haskell-src-meta really neccessary, I mean, is there
any other package that provides the functionality of aforementioned
parseExp function?
Can I upload the fixed version of haskell-src-meta package to Hackage
and assume its maintenance while Matt Morrow is silent?
Does anyone know how to contact Matt Morrow? His is not replying on my
emails sent to the email address specified in the package description.
The thing is that I do not want my package to be dependent on a
package that is broken on Hackage.

Cheers, George

George Giorgidze

More information about the Haskell-Cafe mailing list