From ec9c1ec0db7a7dfc4650b9d1d68069b3bb32bdc4 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 5 Feb 2011 13:38:20 +0100 Subject: Instantiate ArrowChoice for Compiler --- src/Hakyll/Core/Compiler/Internal.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Hakyll') 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 -- cgit v1.2.3