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:
parent
ea87105b4b
commit
e33014ef27
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user