Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
7d3b8936
Commit
7d3b8936
authored
Jul 07, 2018
by
Alexis Williams
Browse files
Expose `parseGhcEnvironmentFile`.
parent
c434e82f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/GHC.hs
View file @
7d3b8936
...
...
@@ -60,6 +60,7 @@ module Distribution.Simple.GHC (
Internal
.
writeGhcEnvironmentFile
,
Internal
.
ghcPlatformAndVersionString
,
readGhcEnvironmentFile
,
parseGhcEnvironmentFile
,
ParseErrorExc
(
..
),
-- * Version-specific implementation quirks
getImplInfo
,
...
...
Cabal/Distribution/Simple/GHC/EnvironmentParser.hs
View file @
7d3b8936
...
...
@@ -5,7 +5,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
module
Distribution.Simple.GHC.EnvironmentParser
(
readGhcEnvironmentFile
,
ParseErrorExc
(
..
)
)
where
(
parseGhcEnvironmentFile
,
readGhcEnvironmentFile
,
ParseErrorExc
(
..
)
)
where
import
Prelude
()
import
Distribution.Compat.Prelude
...
...
@@ -42,10 +42,10 @@ newtype ParseErrorExc = ParseErrorExc P.ParseError
instance
Exception
ParseErrorExc
parseEnvironmentFile
::
Parser
[
GhcEnvironmentFileEntry
]
parseEnvironmentFile
=
parseEnvironmentFileLine
`
P
.
sepEndBy
`
P
.
endOfLine
<*
P
.
eof
parse
Ghc
EnvironmentFile
::
Parser
[
GhcEnvironmentFileEntry
]
parse
Ghc
EnvironmentFile
=
parseEnvironmentFileLine
`
P
.
sepEndBy
`
P
.
endOfLine
<*
P
.
eof
readGhcEnvironmentFile
::
FilePath
->
IO
[
GhcEnvironmentFileEntry
]
readGhcEnvironmentFile
path
=
either
(
throwIO
.
ParseErrorExc
)
return
=<<
parseFromFile
parseEnvironmentFile
path
parseFromFile
parse
Ghc
EnvironmentFile
path
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment