Skip to content

Commit

Permalink
Define Semigroup Void instance on base-4.8.0.0 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Apr 6, 2015
1 parent 11b52b6 commit c29113e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Data/Semigroup.hs
Expand Up @@ -89,6 +89,7 @@ import Prelude hiding (foldr1)

#if MIN_VERSION_base(4,8,0)
import Data.Bifunctor
import Data.Void
#else
import Data.Monoid (Monoid(..))
import Data.Foldable
Expand Down Expand Up @@ -321,6 +322,12 @@ instance Semigroup (Monoid.Last a) where
times1p _ a = a
#endif

#if MIN_VERSION_base(4,8,0)
instance Semigroup Void where
a <> _ = a
times1p _ a = a
#endif

instance Semigroup (NonEmpty a) where
(a :| as) <> ~(b :| bs) = a :| (as ++ b : bs)

Expand Down

0 comments on commit c29113e

Please sign in to comment.