[commit: packages/containers] ghc-head: Provide explicit definition for <*> instead of using ap. (8e4996a)

git at git.haskell.org git at git.haskell.org
Fri Aug 30 13:34:33 CEST 2013


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

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/containers.git;a=commit;h=8e4996a07339bcef9d5acc207dcefff18d981e39

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

commit 8e4996a07339bcef9d5acc207dcefff18d981e39
Author: Milan Straka <fox at ucw.cz>
Date:   Wed Nov 14 21:50:33 2012 +0100

    Provide explicit definition for <*> instead of using ap.


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

8e4996a07339bcef9d5acc207dcefff18d981e39
 Data/Sequence.hs |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Data/Sequence.hs b/Data/Sequence.hs
index a11dec1..9bfd6f9 100644
--- a/Data/Sequence.hs
+++ b/Data/Sequence.hs
@@ -202,7 +202,8 @@ instance Monad Seq where
 
 instance Applicative Seq where
     pure = singleton
-    (<*>) = ap
+    fs <*> xs = foldl' add empty fs
+      where add ys f = ys >< fmap f xs
 
 instance MonadPlus Seq where
     mzero = empty





More information about the ghc-commits mailing list