1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

Remove the Monoid instance for App, as it’s unlawful.

This commit is contained in:
Rob Rix 2018-03-21 17:26:32 -04:00
parent aab509cf63
commit 6a785e0b30

View File

@ -21,13 +21,6 @@ newtype App f a = App { runApp :: f a }
instance Applicative f => Semigroup (App f a) where
App a <> App b = App (a *> b)
-- $ Identity:
-- prop> \ a -> mempty <> a == (a :: App Maybe String)
-- prop> \ a -> a <> mempty == (a :: App Maybe String)
instance (Applicative f, Monoid a) => Monoid (App f a) where
mempty = App (pure mempty)
mappend = (<>)
-- | 'Semigroup' under '<*>' and '<>'.
newtype AppMerge f a = AppMerge { runAppMerge :: f a }