@@ -42,7 +42,6 @@ import Data.Time.Clock
42import Data.Function (on)
42import Data.Function (on)
43import Data.Maybe (fromMaybe)
43import Data.Maybe (fromMaybe)
44import Data.FileEmbed (embedFile)
44import Data.FileEmbed (embedFile)
45−import Data.Traversable (traverse)
47import Control.Monad.Error
46import Control.Monad.Error
48import Control.Arrow ((&&&))
47import Control.Arrow ((&&&))
@@ -142,6 +141,11 @@ data RebuildPolicy
142 -- | Always rebuild this module
141 -- | Always rebuild this module
143 | RebuildAlways deriving (Show, Eq, Ord)
142 | RebuildAlways deriving (Show, Eq, Ord)
144+-- Traverse (Either e) instance (base 4.7)
145+traverseEither :: Applicative f => (a -> f b) -> Either e a -> f (Either e b)
146+traverseEither _ (Left x) = pure (Left x)
147+traverseEither f (Right y) = Right <$> f y
146-- Compiles in "make" mode, compiling each module separately to a js files and an externs file
150-- Compiles in "make" mode, compiling each module separately to a js files and an externs file
@@ -163,7 +167,7 @@ make outputDir opts ms prefix = do
164 jsTimestamp <- getTimestamp jsFile
168 jsTimestamp <- getTimestamp jsFile
165 externsTimestamp <- getTimestamp externsFile
169 externsTimestamp <- getTimestamp externsFile
166− inputTimestamp <- traverse getTimestamp inputFile
170+ inputTimestamp <- traverseEither getTimestamp inputFile
168 return $ case (inputTimestamp, jsTimestamp, externsTimestamp) of
172 return $ case (inputTimestamp, jsTimestamp, externsTimestamp) of
169 (Right (Just t1), Just t2, Just t3) | t1 < min t2 t3 -> s
173 (Right (Just t1), Just t2, Just t3) | t1 < min t2 t3 -> s