add an INLINE to the list version of traverse, to enable fusion
authorSimon Marlow <marlowsd@gmail.com>
Tue, 8 Jun 2010 08:25:31 +0000 (08:25 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 8 Jun 2010 08:25:31 +0000 (08:25 +0000)
Data/Traversable.hs

index 0df8bd4..28fa761 100644 (file)
@@ -107,6 +107,7 @@ instance Traversable Maybe where
         traverse f (Just x) = Just <$> f x
 
 instance Traversable [] where
+        {-# INLINE traverse #-} -- so that traverse can fuse
         traverse f = Prelude.foldr cons_f (pure [])
           where cons_f x ys = (:) <$> f x <*> ys