From a5dd1c86edf223d761a5feceb0653f4240481e65 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Thu, 9 Oct 2014 14:56:44 +0900 Subject: [PATCH] Generalize compileError into Quasi constraint. --- names-th/src/Language/Haskell/TH/Lib/Extra.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/names-th/src/Language/Haskell/TH/Lib/Extra.hs b/names-th/src/Language/Haskell/TH/Lib/Extra.hs index 834129e8..63c2a2f5 100644 --- a/names-th/src/Language/Haskell/TH/Lib/Extra.hs +++ b/names-th/src/Language/Haskell/TH/Lib/Extra.hs @@ -25,13 +25,12 @@ module Language.Haskell.TH.Lib.Extra ( ) where import Language.Haskell.TH - (Ppr, ppr, Q, runQ, runIO, + (Ppr, ppr, Q, runQ, Name, Dec, sigD, valD, TypeQ, varP, normalB, ExpQ, litE, integerL) import Language.Haskell.TH.PprLib (Doc) import Language.Haskell.TH.Syntax (Quasi) - {- $extraTemplateFunctions Extra functions to generate haskell templates. -} @@ -65,9 +64,10 @@ which generating haskell templates. -} -- | Raise compile error from TH code. -compileError :: String -> Q a -compileError = runIO . compileErrorIO +compileError :: Quasi m => String -> m a +compileError = runQ . fail -- | 'IO' version of 'compileError'. compileErrorIO :: String -> IO a -compileErrorIO = ioError . userError +compileErrorIO = compileError +{-# DEPRECATED compileErrorIO "Use compileError instead of this" #-}