@@ -2,6 +2,8 @@
22-- | Internally used compiler module
33{-# LANGUAGE GADTs #-}
44{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5+{-# LANGUAGE FlexibleInstances #-}
6+{-# LANGUAGE MultiParamTypeClasses #-}
57module Hakyll.Core.Compiler.Internal
68 ( -- * Types
79 CompilerRead (..)
@@ -29,6 +31,7 @@ import Control.Applicative (Alternative (..),
2931 Applicative (..), (<$>))
3032import Control.Exception (SomeException, handle)
3133import Control.Monad (forM_)
34+import Control.Monad.Error
3235import Data.Monoid (Monoid (..))
3336import Data.Set (Set)
3437import qualified Data.Set as S
@@ -146,6 +149,11 @@ instance MonadMetadata Compiler where
146149 getMetadata = compilerGetMetadata
147150 getMatches = compilerGetMatches
148151
152+--------------------------------------------------------------------------------
153+instance MonadError [String] Compiler where
154+ throwError = compilerThrow
155+ catchError = compilerCatch
156+
149157
150158--------------------------------------------------------------------------------
151159runCompiler :: Compiler a -> CompilerRead -> IO (CompilerResult a)