[commit: ghc] master: ghc-pkg: Express return-method in terms of pure (75c7cda)

git at git.haskell.org git at git.haskell.org
Sun Oct 18 08:52:38 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/75c7cda2a2931bccbb7af5a76278729fccbe4228/ghc

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

commit 75c7cda2a2931bccbb7af5a76278729fccbe4228
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Oct 18 09:18:33 2015 +0200

    ghc-pkg: Express return-method in terms of pure


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

75c7cda2a2931bccbb7af5a76278729fccbe4228
 utils/ghc-pkg/Main.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 4bc6034..13e6d6f 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -1515,11 +1515,11 @@ instance Functor Validate where
     fmap = liftM
 
 instance Applicative Validate where
-    pure = return
+    pure a = V $ pure (a, [], [])
     (<*>) = ap
 
 instance Monad Validate where
-   return a = V $ return (a, [], [])
+   return = pure
    m >>= k = V $ do
       (a, es, ws) <- runValidate m
       (b, es', ws') <- runValidate (k a)



More information about the ghc-commits mailing list