packages feed

GGg 0.1.0.1 → 0.1.0.2

raw patch · 4 files changed

+20/−9 lines, 4 files

Files

GGg.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/  name:                GGg-version:             0.1.0.1+version:             0.1.0.2 synopsis:            GGg cipher -- description:          homepage:            https://github.com/xnil/GGg@@ -18,7 +18,9 @@  executable GGg   main-is:             Main.hs-  other-modules: Conversions+  other-modules:+      CLI,+      Conversions   -- other-extensions:       build-depends:       base >=4.7 && <4.8,
+ src/CLI.hs view
@@ -0,0 +1,11 @@+module CLI +( parseArgs+) where++import Conversions++parseArgs :: [String] -> IO ()+parseArgs ["-g"] = putStr . asciiTextToG =<< getContents+parseArgs ["-a"] = putStr . gTextToAscii =<< getContents+parseArgs []     = putStrLn "No argument provided. Try `-g' or `-a'."+parseArgs _      = putStrLn "Invalid arguments."
src/Conversions.hs view
@@ -1,4 +1,7 @@-module Conversions where+module Conversions+( asciiTextToG+, gTextToAscii+) where  import qualified Data.Bimap as Bimap import Data.Maybe (fromMaybe)
src/Main.hs view
@@ -1,13 +1,8 @@ module Main where -import Conversions+import CLI import System.Environment  main :: IO () main = parseArgs =<< getArgs -parseArgs :: [String] -> IO ()-parseArgs ["-g"]        = putStr . asciiTextToG =<< getContents-parseArgs ["-a"]        = putStr . gTextToAscii =<< getContents-parseArgs []            = putStrLn "No argument provided. Try `-g' or `-a'."-parseArgs args          = putStrLn "Invalid arguments."