1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Add a Monoid instance for Join.

This commit is contained in:
Rob Rix 2016-02-28 21:18:03 -05:00
parent ea87105b4b
commit e33014ef27

View File

@ -6,3 +6,7 @@ newtype Join a = Join { runJoin :: (a, a) }
instance Applicative Join where
pure a = Join (a, a)
Join (f, g) <*> Join (a, b) = Join (f a, g b)
instance Monoid a => Monoid (Join a) where
mempty = pure mempty
mappend a b = pure mappend <*> a <*> b