summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-05 13:38:20 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-05 13:38:20 +0100
commitec9c1ec0db7a7dfc4650b9d1d68069b3bb32bdc4 (patch)
tree4cb6ec7798a5daf5ed3fe2c946d13d13ae26221f
parentc093761e8941c1605b6131c411ca995588c10c2e (diff)
downloadhakyll-ec9c1ec0db7a7dfc4650b9d1d68069b3bb32bdc4.tar.gz
Instantiate ArrowChoice for Compiler
-rw-r--r--src/Hakyll/Core/Compiler/Internal.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs
index ccdd557..6737b6a 100644
--- a/src/Hakyll/Core/Compiler/Internal.hs
+++ b/src/Hakyll/Core/Compiler/Internal.hs
@@ -20,7 +20,7 @@ import Control.Monad ((<=<), liftM2)
import Data.Set (Set)
import qualified Data.Set as S
import Control.Category (Category, (.), id)
-import Control.Arrow (Arrow, arr, first)
+import Control.Arrow (Arrow, ArrowChoice, arr, first, left)
import Hakyll.Core.Identifier
import Hakyll.Core.ResourceProvider
@@ -78,6 +78,11 @@ instance Arrow Compiler where
x' <- j x
return (x', y)
+instance ArrowChoice Compiler where
+ left (Compiler d j) = Compiler d $ \e -> case e of
+ Left l -> Left <$> j l
+ Right r -> Right <$> return r
+
-- | Run a compiler, yielding the resulting target and it's dependencies
--
runCompilerJob :: Compiler () a -- ^ Compiler to run