Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify

  • Loading branch information...
commit 9fef49c7cfbb8b1b29d4ba8f6940bedaee1252d4 1 parent cd84d53
@yaxu authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Pattern.hs
View
4 Pattern.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.