on master help sign in
Lazy pattern matching for compiler composition
commitf56eb538b6e366202f796c84eee46e620f519ff6 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 7 Feb 2011, 16:01 (16 years ago) parent986a74b
2 files changed+4−2
src/Hakyll/Core/Compiler/Internal.hs+1−1 src/Hakyll/Core/Util/Arrow.hs+3−1
src/Hakyll/Core/Compiler/Internal.hs+1−1
@@ -69,7 +69,7 @@ instance Applicative (Compiler a) where
6969
7070instance Category Compiler where
7171 id = Compiler (return S.empty) return
72− (Compiler d1 j1) . (Compiler d2 j2) =
72+ ~(Compiler d1 j1) . ~(Compiler d2 j2) =
7373 Compiler (liftM2 S.union d1 d2) (j1 <=< j2)
7474
7575instance Arrow Compiler where
src/Hakyll/Core/Util/Arrow.hs+3−1
@@ -7,6 +7,8 @@ module Hakyll.Core.Util.Arrow
77 , mapA
88 ) where
99
10+import Prelude hiding (id)
11+import Control.Category (id)
1012import Control.Arrow ( Arrow, ArrowChoice, (&&&), arr, (>>^), (|||)
1113 , (>>>), (***)
1214 )
@@ -30,7 +32,7 @@ unitA = constA ()
3032mapA :: ArrowChoice a
3133 => a b c
3234 -> a [b] [c]
33−mapA f = arr listEither >>> arr id ||| (f *** mapA f >>> arr (uncurry (:)))
35+mapA f = arr listEither >>> id ||| (f *** mapA f >>> arr (uncurry (:)))
3436 where
3537 listEither [] = Left []
3638 listEither (x : xs) = Right (x, xs)