[commit: packages/Cabal] ghc-head: Correct applicative instance (2ad0b45)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:28:07 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=2ad0b45a85365bc8d5547bacd0065d5f9c885251

>---------------------------------------------------------------

commit 2ad0b45a85365bc8d5547bacd0065d5f9c885251
Author: Benno Fünfstück <benno.fuenfstueck at gmail.com>
Date:   Wed Jul 10 19:33:09 2013 +0200

    Correct applicative instance


>---------------------------------------------------------------

2ad0b45a85365bc8d5547bacd0065d5f9c885251
 Cabal/Distribution/ParseUtils.hs |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Cabal/Distribution/ParseUtils.hs b/Cabal/Distribution/ParseUtils.hs
index 3923d77..71fc8d6 100644
--- a/Cabal/Distribution/ParseUtils.hs
+++ b/Cabal/Distribution/ParseUtils.hs
@@ -87,7 +87,7 @@ import Data.Char (isSpace, toLower, isAlphaNum, isDigit)
 import Data.Maybe       (fromMaybe)
 import Data.Tree as Tree (Tree(..), flatten)
 import qualified Data.Map as Map
-import Control.Monad (foldM) 
+import Control.Monad (foldM, join) 
 import Control.Applicative (Applicative(..))
 import System.FilePath (normalise)
 import Data.List (sortBy)
@@ -122,7 +122,7 @@ instance Functor ParseResult where
         
 instance Applicative ParseResult where
         pure = ParseOk []
-        f <*> a = join $ fmap (\f' -> fmap f' a)
+        f <*> a = f >>= \f' -> fmap f' a
 
 instance Monad ParseResult where
         return = ParseOk []





More information about the ghc-commits mailing list