Skip to content
Snippets Groups Projects
Commit cf6f3fcf authored by Alex Biehl's avatar Alex Biehl
Browse files

Generate Paths_ module with qualified Data.List.last import

parent 47eaa718
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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 %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment