Skip to content

Commit d5fbf11

Browse files
authored
Merge pull request #3 from DzyubSpirit/patch-1
Update maybe3.hs
2 parents c3ea025 + 93ed81a commit d5fbf11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Haskell/maybe3.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ instance Applicative Maybe where
1616
Nothing <*> _ = Nothing
1717

1818
main = do
19-
let a = Just 5
20-
b = Just $ (* 2) . (+ 5) . (^ 2)
21-
c = b <*> a
22-
print c
19+
print $ (*) <$> Nothing <*> Nothing
20+
print $ (*) <$> Nothing <*> Just 2
21+
print $ (*) <$> Just 3 <*> Nothing
22+
print $ (*) <$> Just 3 <*> Just 2

0 commit comments

Comments
 (0)