diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-10 13:26:39 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-10 13:26:39 +0100 |
commit | 6b11cba1ef50892adf6a9f45e1f21c8da79b7858 (patch) | |
tree | b5e6922b257977fc368efee7ad561b21086caa1e /src/Hakyll/Core/Compiler | |
parent | 4cb6f9241435fae7a23a7f9fbbdab99e65285eff (diff) | |
download | hakyll-6b11cba1ef50892adf6a9f45e1f21c8da79b7858.tar.gz |
Context module?
Diffstat (limited to 'src/Hakyll/Core/Compiler')
-rw-r--r-- | src/Hakyll/Core/Compiler/Internal.hs | 6 |
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 -------------------------------------------------------------------------------- |