From 617322ae8ce039fcd36a7a7629a822522454a1af Mon Sep 17 00:00:00 2001 From: "Ivan N. Veselov" Date: Fri, 3 May 2013 19:10:11 +0300 Subject: Added MonadError's instance for Compiler. --- src/Hakyll/Core/Compiler/Internal.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Hakyll/Core/Compiler/Internal.hs') diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs index bf384bf..fbb7528 100644 --- a/src/Hakyll/Core/Compiler/Internal.hs +++ b/src/Hakyll/Core/Compiler/Internal.hs @@ -2,6 +2,8 @@ -- | Internally used compiler module {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} module Hakyll.Core.Compiler.Internal ( -- * Types CompilerRead (..) @@ -29,6 +31,7 @@ import Control.Applicative (Alternative (..), Applicative (..), (<$>)) import Control.Exception (SomeException, handle) import Control.Monad (forM_) +import Control.Monad.Error import Data.Monoid (Monoid (..)) import Data.Set (Set) import qualified Data.Set as S @@ -146,6 +149,11 @@ instance MonadMetadata Compiler where getMetadata = compilerGetMetadata getMatches = compilerGetMatches +-------------------------------------------------------------------------------- +instance MonadError [String] Compiler where + throwError = compilerThrow + catchError = compilerCatch + -------------------------------------------------------------------------------- runCompiler :: Compiler a -> CompilerRead -> IO (CompilerResult a) -- cgit v1.2.3