Skip to content

Commit 2bf5c01

Browse files
committed
Remove deriving Monoid from Name.
1 parent 0a96e00 commit 2bf5c01

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/GraphQL/Internal/Name.hs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import Data.Text as T (Text)
2525
import qualified Data.Attoparsec.Text as A
2626
import Test.QuickCheck (Arbitrary(..), elements, listOf)
2727
import Data.String (IsString(..))
28-
import Data.Text as T (Text, append, empty)
2928

3029
import GraphQL.Internal.Syntax.Tokens (tok)
3130

@@ -36,14 +35,6 @@ import GraphQL.Internal.Syntax.Tokens (tok)
3635
-- https://facebook.github.io/graphql/#sec-Names
3736
newtype Name = Name { unName :: T.Text } deriving (Eq, Ord, Show)
3837

39-
-- | Allow Name to be parsed with `optempty`
40-
--
41-
-- Example: node = AST.Node <$> optempty nameParser
42-
-- I.e. If nameParser fails, the Name field of AST.Node is set
43-
-- mempty rather than propagating a failure.
44-
instance Monoid Name where
45-
mempty = Name T.empty
46-
mappend (Name a1) (Name a2) = Name (T.append a1 a2)
4738

4839
-- | Create a 'Name', panicking if the given text is invalid.
4940
--

0 commit comments

Comments
 (0)