avoid head
This commit is contained in:
parent
0833eb43a6
commit
ac71ab7bd7
2 changed files with 7 additions and 5 deletions
|
@ -67,7 +67,9 @@ runWebApp app observer = do
|
|||
localSocket :: IO Socket
|
||||
localSocket = do
|
||||
addrs <- getAddrInfo (Just hints) (Just localhost) Nothing
|
||||
go $ Prelude.head addrs
|
||||
case addrs of
|
||||
[] -> error "unable to bind to a local socket"
|
||||
(addr:_) -> go addr
|
||||
where
|
||||
hints = defaultHints
|
||||
{ addrFlags = [AI_ADDRCONFIG]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue