Skip to content

Instantly share code, notes, and snippets.

@greydot
Created June 19, 2018 19:17
Show Gist options
  • Save greydot/b61836d8a7991da1bad37ed4ac4b0584 to your computer and use it in GitHub Desktop.
Save greydot/b61836d8a7991da1bad37ed4ac4b0584 to your computer and use it in GitHub Desktop.
{-# LANGUAGE ScopedTypeVariables #-}
import Data.IP
import Data.IP.RouteTable (IPRTable)
import qualified Data.IP.RouteTable as RT
import System.Environment (getArgs)
main :: IO ()
main = do [path] <- getArgs
nets <- map read . lines <$> readFile path
let rt :: IPRTable IPv4 () = RT.fromList $ zip nets (repeat ())
print $ length rt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment