Permalink
Browse files

simplify

  • Loading branch information...
1 parent cd84d53 commit 9fef49c7cfbb8b1b29d4ba8f6940bedaee1252d4 @yaxu committed Mar 6, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 Pattern.hs
View
@@ -25,8 +25,8 @@ instance Monad Pattern where
instance Applicative Pattern where
pure = Atom
- Atom f <*> xs = mapAtom (fmap f) xs
- fs <*> (Atom x) = mapAtom (\(Atom f) -> Atom $ f x) fs
+ Atom f <*> xs = f <$> xs
+ fs <*> (Atom x) = (\f -> f x) <$> fs
(Cycle fs) <*> xs = Cycle $ map (<*> xs) fs
fs <*> (Cycle xs) = Cycle $ map (fs <*>) xs

0 comments on commit 9fef49c

Please sign in to comment.