1 {-# LANGUAGE OverloadedStrings #-}
5 import Prelude hiding (readFile)
6 import System.Environment
7 import Data.ByteString.Lazy (ByteString)
8 import Data.ByteString.Lazy.Char8 (readFile)
10 import Control.Exception
14 queryOp :: String -> IO (Either String ByteString)
15 queryOp key = catch (readFile key >>= return . Right)
16 (\e -> return (Left (show (e :: IOException))))
20 descendNmcDom queryOp [] (seedNmcDom d) >>= print
21 descendNmcDom queryOp ["_tcp","_smtp"] (seedNmcDom d) >>= print