diff --git a/src/Algebra/Graph/Export.hs b/src/Algebra/Graph/Export.hs index 473eabab..f7d77074 100644 --- a/src/Algebra/Graph/Export.hs +++ b/src/Algebra/Graph/Export.hs @@ -37,7 +37,7 @@ import Algebra.Graph.Internal -- implementation uses difference lists). Here @s@ is the type of abstract -- symbols or strings (text or binary). 'Doc' @s@ is a 'Monoid', therefore -- 'mempty' corresponds to the /empty document/ and two documents can be --- concatenated with 'mappend' (or operator 'Data.Monoid.<>'). Documents +-- concatenated with 'mappend' (or operator 'Data.Semigroup.<>'). Documents -- comprising a single symbol or string can be constructed using the function -- 'literal'. Alternatively, you can construct documents as string literals, -- e.g. simply as @"alga"@, by using the @OverloadedStrings@ GHC extension. To @@ -91,7 +91,7 @@ isEmpty (Doc xs) = null xs -- constructed directly from string literals (see the second example below). -- -- @ --- literal "Hello, " 'Data.Monoid.<>' literal "World!" == literal "Hello, World!" +-- literal "Hello, " 'Data.Semigroup.<>' literal "World!" == literal "Hello, World!" -- literal "I am just a string literal" == "I am just a string literal" -- 'render' . literal == 'id' -- @ @@ -101,8 +101,8 @@ literal = Doc . pure -- | Render the document as a single string. An inverse of the function 'literal'. -- -- @ --- render ('literal' "al" 'Data.Monoid.<>' 'literal' "ga") :: ('IsString' s, 'Monoid' s) => s --- render ('literal' "al" 'Data.Monoid.<>' 'literal' "ga") == "alga" +-- render ('literal' "al" 'Data.Semigroup.<>' 'literal' "ga") :: ('IsString' s, 'Monoid' s) => s +-- render ('literal' "al" 'Data.Semigroup.<>' 'literal' "ga") == "alga" -- render 'mempty' == 'mempty' -- render . 'literal' == 'id' -- @ diff --git a/src/Algebra/Graph/Label.hs b/src/Algebra/Graph/Label.hs index e0a1c283..dc41588a 100644 --- a/src/Algebra/Graph/Label.hs +++ b/src/Algebra/Graph/Label.hs @@ -71,7 +71,7 @@ Instances of this type class must satisfy the following semiring laws: > x <.> (y <+> z) == x <.> y <+> x <.> z > (x <+> y) <.> z == x <.> z <+> y <.> z -} -class (Monoid a, Semigroup a) => Semiring a where +class Monoid a => Semiring a where one :: a (<.>) :: a -> a -> a diff --git a/test/Algebra/Graph/Test/Arbitrary.hs b/test/Algebra/Graph/Test/Arbitrary.hs index 3e88cff7..be373751 100644 --- a/test/Algebra/Graph/Test/Arbitrary.hs +++ b/test/Algebra/Graph/Test/Arbitrary.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- |