Skip to content

Instantly share code, notes, and snippets.

@miikka
Created November 8, 2010 15:12
Show Gist options
  • Save miikka/667791 to your computer and use it in GitHub Desktop.
Save miikka/667791 to your computer and use it in GitHub Desktop.
Haddock breaks when a module uses quasiquotes.
$ 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]
{-# LANGUAGE QuasiQuotes #-}
import Quasi
f [$qq|test|] = True
f _ = False
main = do
print [$qq|test|]
print $ f [$qq|test|]
print $ f [$qq|test 2|]
{-# 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