Skip to content

Commit

Permalink
Add Semigroup instances for GHC 8.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz committed Apr 24, 2018
1 parent fc711de commit 017e1bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Yi/Rope.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# language CPP #-}
{-# language BangPatterns #-}
{-# language DeriveDataTypeable #-}
{-# language LambdaCase #-}
Expand Down Expand Up @@ -115,6 +116,11 @@ overChunk f (Chunk l t) = Chunk l (f t)
countNl :: TX.Text -> Int
countNl = TX.count "\n"

#if __GLASGOW_HASKELL__ >= 804
instance Semigroup Size where
(<>) = mappend
#endif

instance Monoid Size where
mempty = Indices 0 0
Indices c l `mappend` Indices c' l' = Indices (c + c') (l + l')
Expand Down Expand Up @@ -153,6 +159,11 @@ instance NFData YiString where
instance IsString YiString where
fromString = Yi.Rope.fromString

#if __GLASGOW_HASKELL__ >= 804
instance Semigroup YiString where
(<>) = mappend
#endif

instance Monoid YiString where
mempty = Yi.Rope.empty
mappend = Yi.Rope.append
Expand Down

0 comments on commit 017e1bd

Please sign in to comment.