Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository 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
Glasgow Haskell Compiler
Packages
Cabal
Commits
cf6f3fcf
Commit
cf6f3fcf
authored
3 years ago
by
Alex Biehl
Browse files
Options
Downloads
Patches
Plain Diff
Generate Paths_ module with qualified Data.List.last import
parent
47eaa718
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
+3
-2
3 additions, 2 deletions
Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
templates/Paths_pkg.template.hs
+3
-2
3 additions, 2 deletions
templates/Paths_pkg.template.hs
with
6 additions
and
4 deletions
Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
+
3
−
2
View file @
cf6f3fcf
...
...
@@ -60,6 +60,7 @@ render z_root = execWriter $ do
return
()
tell
"
\n
"
tell
"import qualified Control.Exception as Exception
\n
"
tell
"import qualified Data.List as List
\n
"
tell
"import Data.Version (Version(..))
\n
"
tell
"import System.Environment (getEnv)
\n
"
tell
"import Prelude
\n
"
...
...
@@ -295,8 +296,8 @@ render z_root = execWriter $ do
tell
"joinFileName
\"
.
\"
fname = fname
\n
"
tell
"joinFileName dir
\"\"
= dir
\n
"
tell
"joinFileName dir fname
\n
"
tell
" | isPathSeparator (last dir) = dir ++ fname
\n
"
tell
" | otherwise = dir ++ pathSeparator : fname
\n
"
tell
" | isPathSeparator (
List.
last dir) = dir ++ fname
\n
"
tell
" | otherwise
= dir ++ pathSeparator : fname
\n
"
tell
"
\n
"
tell
"pathSeparator :: Char
\n
"
if
(
zIsWindows
z_root
)
...
...
This diff is collapsed.
Click to expand it.
templates/Paths_pkg.template.hs
+
3
−
2
View file @
cf6f3fcf
...
...
@@ -21,6 +21,7 @@ import Foreign.C
{
%
endif
%
}
import
qualified
Control.Exception
as
Exception
import
qualified
Data.List
as
List
import
Data.Version
(
Version
(
..
))
import
System.Environment
(
getEnv
)
import
Prelude
...
...
@@ -166,8 +167,8 @@ joinFileName "" fname = fname
joinFileName
"."
fname
=
fname
joinFileName
dir
""
=
dir
joinFileName
dir
fname
|
isPathSeparator
(
last
dir
)
=
dir
++
fname
|
otherwise
=
dir
++
pathSeparator
:
fname
|
isPathSeparator
(
List
.
last
dir
)
=
dir
++
fname
|
otherwise
=
dir
++
pathSeparator
:
fname
pathSeparator
::
Char
{
%
if
isWindows
%
}
...
...
This diff is collapsed.
Click to expand it.
Alex Biehl
@alexbiehl
mentioned in commit
632ee054
·
3 years ago
mentioned in commit
632ee054
mentioned in commit 632ee0548acbe2d9da324a344fd60b716708e742
Toggle commit list
Alex Biehl
@alexbiehl
mentioned in commit
b2789600
·
3 years ago
mentioned in commit
b2789600
mentioned in commit b2789600ca2e24bcd93c7edcedf09cd3bb6edde2
Toggle commit list
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