@@ -20,7 +20,7 @@ import Control.Monad ((<=<), liftM2)
20import Data.Set (Set)
20import Data.Set (Set)
21import qualified Data.Set as S
21import qualified Data.Set as S
22import Control.Category (Category, (.), id)
22import Control.Category (Category, (.), id)
23−import Control.Arrow (Arrow, arr, first)
23+import Control.Arrow (Arrow, ArrowChoice, arr, first, left)
25import Hakyll.Core.Identifier
25import Hakyll.Core.Identifier
26import Hakyll.Core.ResourceProvider
26import Hakyll.Core.ResourceProvider
@@ -78,6 +78,11 @@ instance Arrow Compiler where
79 return (x', y)
79 return (x', y)
81+instance ArrowChoice Compiler where
82+ left (Compiler d j) = Compiler d $ \e -> case e of
83+ Left l -> Left <$> j l
84+ Right r -> Right <$> return r
81-- | Run a compiler, yielding the resulting target and it's dependencies
86-- | Run a compiler, yielding the resulting target and it's dependencies
83runCompilerJob :: Compiler () a -- ^ Compiler to run
88runCompilerJob :: Compiler () a -- ^ Compiler to run