gt-tools 0.1.3 → 0.1.4
raw patch · 2 files changed
+24/−7 lines, 2 files
Files
- Gtc/gtc.hs +23/−6
- gt-tools.cabal +1/−1
Gtc/gtc.hs view
@@ -84,9 +84,26 @@ loop = do minput <- lift promptLine >>= getInputLine case minput of- Nothing -> return ()- Just "" -> loop- Just input -> do t <- lift $ do_trans from to input- outputStrLn $ replicate 80 '-'- outputStrLn t- loop+ Nothing -> return ()+ Just "" -> loop+ -- reverse langs+ Just ('!':input) -> translate to from input+ -- set new langs pair+ Just (':':input) -> liftIO $ uncurry interactiveLoop' $ parse_cmd input+ -- normal mode+ Just input -> translate from to input+ where+ parse_cmd :: String -> (Lang, Lang)+ parse_cmd input =+ case wi of+ nl1:nl2:[] -> (nl1, nl2)+ _ -> (from, to)+ where+ wi = words input++ translate :: String -> String -> String -> InputT IO()+ translate l1 l2 i =+ do t <- lift $ do_trans l1 l2 i+ outputStrLn $ replicate 80 '-'+ outputStrLn t+ loop
gt-tools.cabal view
@@ -1,5 +1,5 @@ name: gt-tools-version: 0.1.3+version: 0.1.4 cabal-version: >= 1.8 build-type: Simple license: GPL