Created
November 8, 2010 15:12
-
-
Save miikka/667791 to your computer and use it in GitHub Desktop.
Haddock breaks when a module uses quasiquotes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ haddock -o doc -h Main.hs Quasi.hs | |
During interactive linking, GHCi couldn't find the following symbol: | |
Quasi_qq_closure | |
This may be due to you not asking GHCi to load extra object files, | |
archives or DLLs needed by your current session. Restart GHCi, specifying | |
the missing library using the -L/path/to/object/dir and -lmissinglibname | |
flags, or simply by naming the relevant files on the GHCi command line. | |
Alternatively, this link failure might indicate a bug in GHCi. | |
If you suspect the latter, please send a bug report to: | |
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE QuasiQuotes #-} | |
import Quasi | |
f [$qq|test|] = True | |
f _ = False | |
main = do | |
print [$qq|test|] | |
print $ f [$qq|test|] | |
print $ f [$qq|test 2|] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveDataTypeable #-} | |
module Quasi (qq, Var (..)) where | |
import Data.Generics | |
import qualified Language.Haskell.TH as TH | |
import Language.Haskell.TH.Quote | |
data Var = Var String deriving (Data, Typeable, Show) | |
qq :: QuasiQuoter | |
qq = QuasiQuoter qqExp qqPat | |
qqExp :: String -> TH.ExpQ | |
qqExp s = dataToExpQ (const Nothing) (Var s) | |
qqPat :: String -> TH.PatQ | |
qqPat s = dataToPatQ (const Nothing) (Var s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment