diff --git a/part2.html b/part2.html index 008968c..073a1ca 100644 --- a/part2.html +++ b/part2.html @@ -3704,8 +3704,7 @@ bob
instance Applicative Maybe where
   pure x = Just x
   liftA2 f (Just x) (Just y) = Just (f x y)
-  liftA2 f Nothing  (Just _) = Nothing
-  liftA2 f (Just _) Nothing  = Nothing
+ liftA2 f _ _ = Nothing

You’ll see the definition uses the same type of failure propagation as the Monad Maybe instance. Let’s use this when parsing monetary values:

data Currency = EUR | USD