@@ -19,8 +19,7 @@ module Hakyll.Core.Compiler.Internal
19--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
20import Control.Applicative (Alternative (..), Applicative,
20import Control.Applicative (Alternative (..), Applicative,
21 pure, (<$>), (<*>))
21 pure, (<$>), (<*>))
22−import Control.Arrow (Arrow, ArrowChoice, arr, first,
22+import Control.Arrow
24import Control.Category (Category, id, (.))
23import Control.Category (Category, id, (.))
25import Control.Monad (liftM2, (<=<))
24import Control.Monad (liftM2, (<=<))
26import Control.Monad.Error (ErrorT, catchError, runErrorT,
25import Control.Monad.Error (ErrorT, catchError, runErrorT,
@@ -137,6 +136,9 @@ instance ArrowChoice Compiler where
137 left ~(Compiler d j) = Compiler d $ \e -> case e of
136 left ~(Compiler d j) = Compiler d $ \e -> case e of
138 Left l -> Left <$> j l
137 Left l -> Left <$> j l
139 Right r -> Right <$> return r
138 Right r -> Right <$> return r
139+ -- Defined here for efficiency
140+ ~(Compiler d1 j1) ||| ~(Compiler d2 j2) = Compiler (liftM2 S.union d1 d2) $
141+ \e -> case e of Left x -> j1 x; Right y -> j2 y
142--------------------------------------------------------------------------------
144--------------------------------------------------------------------------------