Skip to content

Commit 74efeda

Browse files
committed
Put back the original semigroup behaviour
1 parent cb60199 commit 74efeda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Data/Maybe.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ instance invariantMaybe :: Invariant Maybe where
204204
-- | Nothing <> Nothing = Nothing
205205
-- | ```
206206
instance semigroupMaybe :: (Semigroup a) => Semigroup (Maybe a) where
207-
append x y = append <$> x <*> y
207+
append Nothing y = y
208+
append x Nothing = x
209+
append (Just x) (Just y) = Just (x <> y)
208210

209211
instance monoidMaybe :: (Semigroup a) => Monoid (Maybe a) where
210212
mempty = Nothing

0 commit comments

Comments
 (0)