Skip to content

Commit 9db2b21

Browse files
committed
Avoid Data.List.{head,tail}
1 parent b4ee370 commit 9db2b21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

System/Posix/DynamicLinker/Module.hsc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ where
5656

5757
#include "HsUnix.h"
5858

59+
import Prelude hiding (head, tail)
5960
import System.Posix.DynamicLinker
6061
import System.Posix.DynamicLinker.Common
6162
import Foreign.Ptr ( Ptr, nullPtr, FunPtr )
@@ -101,7 +102,7 @@ withModule :: Maybe String
101102
withModule mdir file flags p = do
102103
let modPath = case mdir of
103104
Nothing -> file
104-
Just dir -> dir ++ if ((head (reverse dir)) == '/')
105+
Just dir -> dir ++ if last dir == '/'
105106
then file
106107
else ('/':file)
107108
modu <- moduleOpen modPath flags

0 commit comments

Comments
 (0)