Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
haskell-wasm
GHC
Commits
d99a617b
Commit
d99a617b
authored
3 months ago
by
Ben Gamari
Committed by
Marge Bot
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Move Data ModuleName instance to Language.Haskell.Syntax.Module.Name
Fixes #25968.
parent
aba2a4a5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/GHC/Unit/Types.hs
+0
-9
0 additions, 9 deletions
compiler/GHC/Unit/Types.hs
compiler/Language/Haskell/Syntax/Module/Name.hs
+9
-0
9 additions, 0 deletions
compiler/Language/Haskell/Syntax/Module/Name.hs
with
9 additions
and
9 deletions
compiler/GHC/Unit/Types.hs
+
0
−
9
View file @
d99a617b
{-# OPTIONS_GHC -Wno-orphans #-}
-- instance Data ModuleName
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveTraversable #-}
...
...
@@ -117,13 +115,6 @@ data GenModule unit = Module
}
deriving
(
Eq
,
Ord
,
Data
,
Functor
)
-- TODO: should be moved back into Language.Haskell.Syntax.Module.Name
instance
Data
ModuleName
where
-- don't traverse?
toConstr
_
=
abstractConstr
"ModuleName"
gunfold
_
_
=
error
"gunfold"
dataTypeOf
_
=
mkNoRepType
"ModuleName"
-- | A Module is a pair of a 'Unit' and a 'ModuleName'.
type
Module
=
GenModule
Unit
...
...
This diff is collapsed.
Click to expand it.
compiler/Language/Haskell/Syntax/Module/Name.hs
+
9
−
0
View file @
d99a617b
...
...
@@ -3,6 +3,7 @@ module Language.Haskell.Syntax.Module.Name where
import
Prelude
import
Data.Char
(
isAlphaNum
)
import
Data.Data
import
Control.DeepSeq
import
qualified
Text.ParserCombinators.ReadP
as
Parse
import
System.FilePath
...
...
@@ -12,6 +13,14 @@ import GHC.Data.FastString
-- | A ModuleName is essentially a simple string, e.g. @Data.List@.
newtype
ModuleName
=
ModuleName
FastString
deriving
(
Show
,
Eq
)
instance
Data
ModuleName
where
-- don't traverse?
toConstr
x
=
constr
where
constr
=
mkConstr
(
dataTypeOf
x
)
"{abstract:ModuleName}"
[]
Prefix
gunfold
_
_
=
error
"gunfold"
dataTypeOf
_
=
mkNoRepType
"ModuleName"
instance
Ord
ModuleName
where
nm1
`
compare
`
nm2
=
stableModuleNameCmp
nm1
nm2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment