import Xcdaths import System.Environment (getArgs) main :: IO () main = do -- define dictionary once let lookup = lookupPhrase "/home/hashirama/.local/share/hakurei/dict.bin" -- some other code here , GUI stuff args <- getArgs let searchString = case args of (arg:_) -> arg [] -> "" putStrLn $ "search string was: " ++ searchString -- when you need to lookup something results <- lookup searchString mapM_ putStrLn results