Skip to content

Commit

Permalink
Fix pre-Semigroup-Monoid stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
meooow25 committed Aug 6, 2024
1 parent 4a6c3da commit a0ce261
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions containers/src/Utils/Containers/Internal/EqOrdUtil.hs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{-# LANGUAGE CPP #-}
module Utils.Containers.Internal.EqOrdUtil
( EqM(..)
, OrdM(..)
) where

#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup (Semigroup(..))
#endif
import Utils.Containers.Internal.StrictPair

newtype EqM a = EqM { runEqM :: a -> StrictPair Bool a }
Expand All @@ -14,6 +18,9 @@ instance Semigroup (EqM a) where

instance Monoid (EqM a) where
mempty = EqM (True :*:)
#if !MIN_VERSION_base(4,11,0)
mappend = (<>)
#endif

newtype OrdM a = OrdM { runOrdM :: a -> StrictPair Ordering a }

Expand All @@ -26,3 +33,6 @@ instance Semigroup (OrdM a) where

instance Monoid (OrdM a) where
mempty = OrdM (EQ :*:)
#if !MIN_VERSION_base(4,11,0)
mappend = (<>)
#endif

0 comments on commit a0ce261

Please sign in to comment.