summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Compiler
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-11-10 13:26:39 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-11-10 13:26:39 +0100
commit6b11cba1ef50892adf6a9f45e1f21c8da79b7858 (patch)
treeb5e6922b257977fc368efee7ad561b21086caa1e /src/Hakyll/Core/Compiler
parent4cb6f9241435fae7a23a7f9fbbdab99e65285eff (diff)
downloadhakyll-6b11cba1ef50892adf6a9f45e1f21c8da79b7858.tar.gz
Context module?
Diffstat (limited to 'src/Hakyll/Core/Compiler')
-rw-r--r--src/Hakyll/Core/Compiler/Internal.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs
index 2a3342f..6abeed9 100644
--- a/src/Hakyll/Core/Compiler/Internal.hs
+++ b/src/Hakyll/Core/Compiler/Internal.hs
@@ -19,8 +19,7 @@ module Hakyll.Core.Compiler.Internal
--------------------------------------------------------------------------------
import Control.Applicative (Alternative (..), Applicative,
pure, (<$>), (<*>))
-import Control.Arrow (Arrow, ArrowChoice, arr, first,
- left)
+import Control.Arrow
import Control.Category (Category, id, (.))
import Control.Monad (liftM2, (<=<))
import Control.Monad.Error (ErrorT, catchError, runErrorT,
@@ -137,6 +136,9 @@ instance ArrowChoice Compiler where
left ~(Compiler d j) = Compiler d $ \e -> case e of
Left l -> Left <$> j l
Right r -> Right <$> return r
+ -- Defined here for efficiency
+ ~(Compiler d1 j1) ||| ~(Compiler d2 j2) = Compiler (liftM2 S.union d1 d2) $
+ \e -> case e of Left x -> j1 x; Right y -> j2 y
--------------------------------------------------------------------------------