From 93ed81a94d5d89ce9ed4b0d2effba4cbd3fa587b Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 13 Dec 2016 21:05:25 +0200 Subject: [PATCH] Update maybe3.hs Add more usefull example --- Haskell/maybe3.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Haskell/maybe3.hs b/Haskell/maybe3.hs index 5d340bb..b2d0860 100644 --- a/Haskell/maybe3.hs +++ b/Haskell/maybe3.hs @@ -16,7 +16,7 @@ instance Applicative Maybe where Nothing <*> _ = Nothing main = do - let a = Just 5 - b = Just $ (* 2) . (+ 5) . (^ 2) - c = b <*> a - print c + print $ (*) <$> Nothing <*> Nothing + print $ (*) <$> Nothing <*> Just 2 + print $ (*) <$> Just 3 <*> Nothing + print $ (*) <$> Just 3 <*> Just 2