[commit: base] master: Use sharing in the Alternative instance of Maybe (1d97ad1)
Ian Lynagh
igloo at earth.li
Sat Jan 14 20:36:49 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/1d97ad10283d23b6dfb698a38ae57c29accd6ada
>---------------------------------------------------------------
commit 1d97ad10283d23b6dfb698a38ae57c29accd6ada
Author: Bas van Dijk <v.dijk.bas at gmail.com>
Date: Wed Dec 14 12:24:38 2011 +0100
Use sharing in the Alternative instance of Maybe
>---------------------------------------------------------------
Control/Applicative.hs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Control/Applicative.hs b/Control/Applicative.hs
index bf58bea..3a9db61 100644
--- a/Control/Applicative.hs
+++ b/Control/Applicative.hs
@@ -156,8 +156,8 @@ instance Applicative Maybe where
instance Alternative Maybe where
empty = Nothing
- Nothing <|> p = p
- Just x <|> _ = Just x
+ Nothing <|> r = r
+ l <|> _ = l
instance Applicative [] where
pure = return
More information about the Cvs-libraries
mailing list