1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Define an App semigroup.

This commit is contained in:
Rob Rix 2018-03-21 17:07:49 -04:00
parent 8f22cb26f8
commit 6399cb3c58

View File

@ -1,6 +1,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Data.Semigroup.App
( AppMerge(..)
, App(..)
) where
import Control.Applicative
@ -16,3 +17,7 @@ instance (Applicative f, Semigroup a) => Semigroup (AppMerge f a) where
instance (Applicative f, Monoid a, Semigroup a) => Monoid (AppMerge f a) where
mempty = AppMerge (pure mempty)
mappend = (<>)
newtype App f a = App { runApp :: f a }
deriving (Alternative, Applicative, Bounded, Enum, Eq, Foldable, Functor, Monad, Ord, Show, Traversable)