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
11 import Text.Show.Pretty
16 queryOp :: String -> IO (Either String ByteString)
17 queryOp key = catch (readFile key >>= return . Right)
18 (\e -> return (Left (show (e :: IOException))))
22 descendNmcDom queryOp [] (seedNmcDom d) >>= putStrLn . ppShow