summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorIvan N. Veselov <veselov@gmail.com>2013-05-03 19:10:11 +0300
committerIvan N. Veselov <veselov@gmail.com>2013-05-03 19:10:11 +0300
commit617322ae8ce039fcd36a7a7629a822522454a1af (patch)
treea8de14bfd0de88b3a571eea9a72d8de919ae789a /src/Hakyll
parent51d5242b1f1a3cc9cbc0e58d8d63665c96c327fe (diff)
downloadhakyll-617322ae8ce039fcd36a7a7629a822522454a1af.tar.gz
Added MonadError's instance for Compiler.
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Core/Compiler/Internal.hs8
1 files changed, 8 insertions, 0 deletions
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)