Non-exhaustive pattern in Socket.hsc

Dominic Steinitz dominic.steinitz at
Sat Apr 29 08:34:55 EDT 2006

I'm getting

[root at tility pcap]# ./test
test: Socket.hsc:(1434,17)-(1523,20): Non-exhaustive patterns in case

The problem is caused because pcap_findalldevs is returning an address family 
value of 17

#define PF_PACKET       17      /* Packet family.  */

#define AF_PACKET       PF_PACKET

and the ghc Family datatype doesn't support it :-(

data Family
    | AF_UNIX
    | AF_INET
    | AF_INET6
    | AF_SNA
    | AF_DECnet
    | AF_ROUTE
    | AF_X25
    | AF_AX25
    | AF_IPX
        -- Imported from Network.Socket

*Main> map packFamily 

I think I have two choices:

1. Amend ghc. I haven't built ghc for a long time. Would I have to build the 
whole of ghc? I presume I would have to because of dependencies.

2. Use Network.Alt since 

type Family = Int

Any advice? What is the long term plan for Network anyway?

Thanks, Dominic.

More information about the Libraries mailing list