Skip to content

Commit

Permalink
strict semi-direct products: some optimisations that are know to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-kurur committed Feb 9, 2016
1 parent 04c5370 commit 74b0697
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Data/Monoid/SemiDirectProduct/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ data Semi s m = Semi s !m

instance (Monoid m, Monoid s, Action m s) => Monoid (Semi s m) where
mempty = Semi mempty mempty
{-# INLINE mempty #-}
mappend (Semi xs xm) (Semi ys ym) = Semi (xs `mappend` (xm `act` ys)) (xm `mappend` ym)

{-# INLINE mappend #-}
mconcat = foldr mappend mempty
{-# INLINE mconcat #-}

-- | The quotient map.
quotient :: Semi s m -> m
quotient (Semi _ m) = m
Expand Down

0 comments on commit 74b0697

Please sign in to comment.