diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-05 13:38:20 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-05 13:38:20 +0100 |
commit | ec9c1ec0db7a7dfc4650b9d1d68069b3bb32bdc4 (patch) | |
tree | 4cb6ec7798a5daf5ed3fe2c946d13d13ae26221f | |
parent | c093761e8941c1605b6131c411ca995588c10c2e (diff) | |
download | hakyll-ec9c1ec0db7a7dfc4650b9d1d68069b3bb32bdc4.tar.gz |
Instantiate ArrowChoice for Compiler
-rw-r--r-- | src/Hakyll/Core/Compiler/Internal.hs | 7 |
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 |