@@ -97,53 +97,87 @@ data Compiler a b = Compiler
9797
9898--------------------------------------------------------------------------------
9999instance Functor (Compiler a) where
100− fmap f ~(Compiler d j) = Compiler d $ fmap f . j
100+ fmap f (Compiler d j) = Compiler d $ fmap f . j
101+ {-# INLINE fmap #-}
101102
102103
103104--------------------------------------------------------------------------------
104105instance Applicative (Compiler a) where
105106 pure = fromJob . const . return
106− ~(Compiler d1 j1) <*> ~(Compiler d2 j2) =
107+ {-# INLINE pure #-}
108+
109+ Compiler d1 j1 <*> Compiler d2 j2 =
107110 Compiler (liftM2 S.union d1 d2) $ \x -> j1 x <*> j2 x
111+ {-# INLINE (<*>) #-}
108112
109113
110114--------------------------------------------------------------------------------
111115instance Alternative (Compiler a) where
112116 empty = fromJob $ const $ CompilerM $
113117 throwError "Hakyll.Core.Compiler.Internal: empty alternative"
114− ~(Compiler d1 j1) <|> ~(Compiler d2 j2) =
118+
119+ Compiler d1 j1 <|> Compiler d2 j2 =
115120 Compiler (liftM2 S.union d1 d2) $ \x -> CompilerM $
116121 catchError (unCompilerM $ j1 x) (\_ -> unCompilerM $ j2 x)
122+ {-# INLINE (<|>) #-}
117123
118124
119125--------------------------------------------------------------------------------
120126instance Category Compiler where
121127 id = Compiler (return S.empty) return
122− ~(Compiler d1 j1) . ~(Compiler d2 j2) =
128+ {-# INLINE id #-}
129+
130+ Compiler d1 j1 . Compiler d2 j2 =
123131 Compiler (liftM2 S.union d1 d2) (j1 <=< j2)
132+ {-# INLINE (.) #-}
124133
125134
126135--------------------------------------------------------------------------------
127136instance Arrow Compiler where
128137 arr f = fromJob (return . f)
129− first ~(Compiler d j) = Compiler d $ \(x, y) -> do
138+ {-# INLINE arr #-}
139+
140+ first (Compiler d j) = Compiler d $ \(x, y) -> do
130141 x' <- j x
131142 return (x', y)
143+ {-# INLINE first #-}
144+
145+ second (Compiler d j) = Compiler d $ \(x, y) -> do
146+ y' <- j y
147+ return (x, y')
148+ {-# INLINE second #-}
149+
150+ Compiler d1 j1 *** Compiler d2 j2 =
151+ Compiler (liftM2 S.union d1 d2) $ \(x, y) -> do
152+ x' <- j1 x
153+ y' <- j2 y
154+ return (x', y')
155+ {-# INLINE (***) #-}
156+
157+ Compiler d1 j1 &&& Compiler d2 j2 =
158+ Compiler (liftM2 S.union d1 d2) $ \x -> do
159+ y1 <- j1 x
160+ y2 <- j2 x
161+ return (y1, y2)
162+ {-# INLINE (&&&) #-}
132163
133164
134165--------------------------------------------------------------------------------
135166instance ArrowChoice Compiler where
136− left ~(Compiler d j) = Compiler d $ \e -> case e of
167+ left (Compiler d j) = Compiler d $ \e -> case e of
137168 Left l -> Left <$> j l
138169 Right r -> Right <$> return r
139− -- Defined here for efficiency
140− ~(Compiler d1 j1) ||| ~(Compiler d2 j2) = Compiler (liftM2 S.union d1 d2) $
170+ {-# INLINE left #-}
171+
172+ Compiler d1 j1 ||| Compiler d2 j2 = Compiler (liftM2 S.union d1 d2) $
141173 \e -> case e of Left x -> j1 x; Right y -> j2 y
174+ {-# INLINE (|||) #-}
142175
143176
144177--------------------------------------------------------------------------------
145178instance ArrowMap Compiler where
146179 mapA (Compiler d j) = Compiler d $ mapM j
180+ {-# INLINE mapA #-}
147181
148182
149183--------------------------------------------------------------------------------