module Main (main) where

import Network.Info

main = do
    ifcs <- getNetworkInterfaces
    mapM print ifcs

module Main (main) where

import Network.Info

main = do
    ifs <- getNetworkInterfaces
    mapM (putStrLn . showInterface) ifs

showInterface :: NetworkInterface -> String
showInterface n = netName n ++ "\n"
               ++ "IP Address:   " ++ show (netIP n) ++ "\n"
               ++ "IPv6 Address: " ++ show (netIP6 n) ++ "\n"
               ++ "MAC Address:  " ++ show (netMAC n) ++ "\n"

Test program gives a nicer output
Test program gives a nicer output
