ev :: Store s => ByteString -> Act s ()
ev str = do
  let hdl :: MonadIO m => SomeException -> m (Maybe String)
      hdl _ = return Nothing
  xi <- handle hdl $ do
    getInputLine $ if B.null str then "> " else "| "
  let xj = fmap (flip snoc '\n' . pack) xi
  case xj of
    Nothing -> ev ""
    Just x -> if B.null $ filter (not . isSpace) x
      then ev str
      else if x == ":q\n"
        then outputStrLn "[Quit]"
        else if B.null str && B.take 3 x == ":s "
          then search $ B.dropWhile isSpace $ B.drop 3 x
          else proc $ str`B.append`x
ev :: Store s => ByteString -> Act s ()
ev str = do
  let hdl :: MonadIO m => SomeException -> m (Maybe String)
      hdl _ = return Nothing
  xi <- handle hdl $ do
    getInputLine $ if B.null str then "> " else "| "
  let xj = fmap (flip snoc '\n' . pack) xi
  case xj of
    Nothing -> ev ""
    Just x -> if B.null $ filter (not . isSpace) x
      then ev str
      else if x == ":q\n"
        then outputStrLn "[Quit]"
        else if B.null str && B.take 3 x == ":s "
          then search $ B.dropWhile isSpace $ B.drop 3 x
          else proc $ str`B.append`x
ev str = do
  let hdl :: MonadIO m => SomeException -> m (Maybe String)
      hdl _ = return Nothing
  xi <- handle hdl $ do
    getInputLine $ if B.null str then "> " else "| "
  let xj = fmap (flip snoc '\n' . pack) xi
  case xj of
    Nothing -> ev ""
    Just x -> if B.null $ filter (not . isSpace) x
      then ev str
      else if x == ":q\n"
        then outputStrLn "[Quit]"
        else if B.null str && B.take 3 x == ":s "
          then search $ B.dropWhile isSpace $ B.drop 3 x
          else proc $ str`B.append`x