
On Thu, Jun 11 2015, Adam Bergmark
HSpec uses the ghc -F -pgmF flags to run a custom pre-processor which generates imports before a testing. e.g. '{-# OPTIONS_GHC -F -pgmF hspec-discover #-}'. You might also find some inspiration in the 'imports' library on Hackage: http://hackage.haskell.org/package/imports-0.1.2.1. -Christopher
On Thu, Jun 11, 2015 at 11:12 AM, Corentin Dupont
wrote:
Hi guys, I wanted to know if it's possible to use TH on an "import" statement. What I want to do is to generate the names of the packages I need to import. For example:
import $(genImport "MyPackage")
genImport :: String -> Q TH.Exp genImport s = ...
Is that possible? Thanks! Corentin
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B