Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-exhaustive pattern match warning in src/System/Log/Handler/Syslog.hs #65

Open
sjakobi opened this issue Nov 17, 2021 · 0 comments
Open

Comments

@sjakobi
Copy link

sjakobi commented Nov 17, 2021

With -Wall I get:

src/System/Log/Handler/Syslog.hs:266:19: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In a case alternative:
        Patterns not matched:
            network-3.1.2.5:Network.Socket.Types.SocketType
            (Foreign.C.Types.CInt (GHC.Int.I32# _))
    |
266 |           sent <- case sock_type sh of
    |                   ^^^^^^^^^^^^^^^^^^^^...

sendstr :: String -> IO String
sendstr [] = return []
sendstr omsg = do
sent <- case sock_type sh of
S.Datagram -> sendTo (logsocket sh) omsg (address sh)
S.Stream -> send (logsocket sh) omsg
sendstr (genericDrop sent omsg)

Compare https://hackage.haskell.org/package/network-3.1.2.5/docs/Network-Socket.html#t:SocketType.

If this lack of coverage is unproblematic, it would be nice if there was at least a comment that explains the issue,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant