Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
d956739d
Commit
d956739d
authored
Jan 11, 2015
by
Andrey Mokhov
Browse files
Fit lines into 80 characters.
parent
481caa85
Changes
1
Show whitespace changes
Inline
Side-by-side
src/Oracles/PackageData.hs
View file @
d956739d
...
@@ -12,21 +12,25 @@ import Util
...
@@ -12,21 +12,25 @@ import Util
newtype
PackageDataKey
=
PackageDataKey
(
FilePath
,
String
)
newtype
PackageDataKey
=
PackageDataKey
(
FilePath
,
String
)
deriving
(
Show
,
Typeable
,
Eq
,
Hashable
,
Binary
,
NFData
)
deriving
(
Show
,
Typeable
,
Eq
,
Hashable
,
Binary
,
NFData
)
data
PackageData
=
Modules
FilePath
|
SrcDirs
FilePath
|
PackageKey
FilePath
data
PackageData
=
Modules
FilePath
|
IncludeDirs
FilePath
|
Deps
FilePath
|
DepKeys
FilePath
|
SrcDirs
FilePath
|
PackageKey
FilePath
|
IncludeDirs
FilePath
|
Deps
FilePath
|
DepKeys
FilePath
instance
ShowArgs
PackageData
where
instance
ShowArgs
PackageData
where
showArgs
key
=
do
showArgs
packageData
=
do
let
(
key
Name
,
file
,
ifEmpty
)
=
case
key
of
let
(
key
,
file
,
defaultValue
)
=
case
packageData
of
Modules
file
->
(
"MODULES"
,
file
,
""
)
Modules
file
->
(
"MODULES"
,
file
,
""
)
SrcDirs
file
->
(
"HS_SRC_DIRS"
,
file
,
"."
)
SrcDirs
file
->
(
"HS_SRC_DIRS"
,
file
,
"."
)
PackageKey
file
->
(
"PACKAGE_KEY"
,
file
,
""
)
PackageKey
file
->
(
"PACKAGE_KEY"
,
file
,
""
)
IncludeDirs
file
->
(
"INCLUDE_DIRS"
,
file
,
"."
)
IncludeDirs
file
->
(
"INCLUDE_DIRS"
,
file
,
"."
)
Deps
file
->
(
"DEPS"
,
file
,
""
)
Deps
file
->
(
"DEPS"
,
file
,
""
)
DepKeys
file
->
(
"DEP_KEYS"
,
file
,
""
)
DepKeys
file
->
(
"DEP_KEYS"
,
file
,
""
)
keyFullName
=
replaceSeparators
'_'
$
takeDirectory
file
++
"_"
++
key
Name
fullKey
=
replaceSeparators
'_'
$
takeDirectory
file
++
"_"
++
key
res
<-
askOracle
$
PackageDataKey
(
file
,
keyFullName
)
res
<-
askOracle
$
PackageDataKey
(
file
,
fullKey
)
return
$
words
$
case
res
of
return
$
words
$
case
res
of
Nothing
->
error
$
"
\n
Cannot find
key '"
++
key
Name
++
"' in "
++
file
++
"."
Nothing
->
error
$
"
No
key '"
++
key
++
"' in "
++
file
++
"."
Just
""
->
ifEmpty
Just
""
->
defaultValue
Just
value
->
value
Just
value
->
value
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment