1 {-# LANGUAGE OverloadedStrings #-}
5 import Prelude hiding (readFile)
6 import Data.ByteString.Lazy (ByteString)
7 import Data.ByteString.Lazy.Char8 (unpack, readFile)
9 import Control.Exception
13 queryOp :: ByteString -> IO (Either String ByteString)
14 queryOp key = catch (readFile ("d/" ++ (unpack key)) >>= return . Right)
15 (\e -> return (Left (show (e :: IOException))))
18 d <- queryDom queryOp "root"