Fix typo in conditional compilation
This commit is contained in:
parent
04ff72f680
commit
c6dd2883d2
1 changed files with 7 additions and 4 deletions
|
@ -67,15 +67,18 @@ host hostname = Host hostname defaultPort
|
||||||
|
|
||||||
showHostPort :: Host -> String
|
showHostPort :: Host -> String
|
||||||
-- ^ Display host as \"host:port\"
|
-- ^ Display host as \"host:port\"
|
||||||
showHostPort (Host hostname port) = hostname ++ ":" ++ (case port of
|
-- TODO: Distinguish Service and UnixSocket port
|
||||||
|
showHostPort (Host hostname port) = hostname ++ ":" ++ portname where
|
||||||
|
portname = case port of
|
||||||
Service s -> s
|
Service s -> s
|
||||||
PortNumber p -> show p
|
PortNumber p -> show p
|
||||||
#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) && !defined(_WIN32)
|
#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) && !defined(_WIN32)
|
||||||
UnixSocket s -> s)
|
UnixSocket s -> s
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
readHostPortM :: (Monad m) => String -> m Host
|
readHostPortM :: (Monad m) => String -> m Host
|
||||||
-- ^ Read string \"hostname:port\" as @Host hosthame port@ or \"hostname\" as @host hostname@ (default port). Fail if string does not match either syntax.
|
-- ^ Read string \"hostname:port\" as @Host hosthame port@ or \"hostname\" as @host hostname@ (default port). Fail if string does not match either syntax.
|
||||||
|
-- TODO: handle Service and UnixSocket port
|
||||||
readHostPortM = either (fail . show) return . parse parser "readHostPort" where
|
readHostPortM = either (fail . show) return . parse parser "readHostPort" where
|
||||||
hostname = many1 (letter <|> digit <|> char '-' <|> char '.')
|
hostname = many1 (letter <|> digit <|> char '-' <|> char '.')
|
||||||
parser = do
|
parser = do
|
||||||
|
|
Loading…
Reference in a new issue