From 6b11cba1ef50892adf6a9f45e1f21c8da79b7858 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 10 Nov 2012 13:26:39 +0100 Subject: Context module? --- src/Hakyll/Core/Compiler/Internal.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Hakyll/Core/Compiler') 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 -------------------------------------------------------------------------------- -- cgit v1.2.3