@@ -42,7 +42,6 @@ import Data.Time.Clock
4242import Data.Function (on)
4343import Data.Maybe (fromMaybe)
4444import Data.FileEmbed (embedFile)
45−import Data.Traversable (traverse)
4645
4746import Control.Monad.Error
4847import Control.Arrow ((&&&))
@@ -142,6 +141,11 @@ data RebuildPolicy
142141 -- | Always rebuild this module
143142 | RebuildAlways deriving (Show, Eq, Ord)
144143
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
148+
145149-- |
146150-- Compiles in "make" mode, compiling each module separately to a js files and an externs file
147151--
@@ -163,7 +167,7 @@ make outputDir opts ms prefix = do
163167
164168 jsTimestamp <- getTimestamp jsFile
165169 externsTimestamp <- getTimestamp externsFile
166− inputTimestamp <- traverse getTimestamp inputFile
170+ inputTimestamp <- traverseEither getTimestamp inputFile
167171
168172 return $ case (inputTimestamp, jsTimestamp, externsTimestamp) of
169173 (Right (Just t1), Just t2, Just t3) | t1 < min t2 t3 -> s