From 2b467a747df246090d1fd0270ea9bd4192ebe3df Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Sat, 23 May 2015 04:56:18 -0700 Subject: Build executable with '-threaded' (fixes #399) --- html-test/src/Threaded_TH.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 html-test/src/Threaded_TH.hs (limited to 'html-test/src/Threaded_TH.hs') diff --git a/html-test/src/Threaded_TH.hs b/html-test/src/Threaded_TH.hs new file mode 100644 index 00000000..53e5a399 --- /dev/null +++ b/html-test/src/Threaded_TH.hs @@ -0,0 +1,13 @@ +-- | Imported by 'Threaded', since a TH splice can't be used in the +-- module where it is defined. +module Threaded_TH where + +import Control.Concurrent (forkOS) +import Language.Haskell.TH.Syntax (Exp (LitE), Lit (IntegerL), Q, runIO) + +-- | forkOS requires the threaded RTS, so this TH fails if haddock was +-- built without @-threaded@. +forkTH :: Q Exp +forkTH = do + _ <- runIO (forkOS (return ())) + return (LitE (IntegerL 0)) -- cgit v1.2.3