Skip to content

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

Open
@sjakobi

Description

@sjakobi

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions