gvti 0.2.0.1 → 0.3.0.0
raw patch · 6 files changed
+41/−39 lines, 6 filesdep ~basedep ~directorydep ~mmsyn3PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, directory, mmsyn3, process
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Formatting.hs +7/−3
- GVTI.hs +13/−25
- LICENSE +1/−1
- Main.hs +10/−4
- gvti.cabal +6/−6
ChangeLog.md view
@@ -20,3 +20,7 @@ * Second version revised A. Fixed issue with the colon as the formatting delimiter. Some minor error handling improvements. +## 0.3.0.0 -- 2023-02-01++* Third version. Switched to NoImplicitPrelude extension. Some minor code in messages improvements. Updated the dependencies boundaries.+
Formatting.hs view
@@ -4,16 +4,20 @@ {-| Module : Formatting Description : GraphViz Tabular Interface formatting functionality to be used with the @gvti -g@.-Copyright : (c) OleksandrZhabenko, 2017-2022+Copyright : (c) Oleksandr Zhabenko, 2017-2023 License : MIT-Maintainer : olexandr543@yahoo.com+Maintainer : oleksandr.zhabenko@yahoo.com Stability : Experimental -} +{-# LANGUAGE NoImplicitPrelude #-}+ module Formatting where -import Data.List+import GHC.Base+import GHC.List+import GHC.Num ((+), (-)) import Text.Read (readMaybe) import Data.Maybe (fromMaybe) import Data.Char (isDigit)
GVTI.hs view
@@ -1,13 +1,13 @@ {-# OPtIONS_HADDOCK show-extensions #-}-{-# LANGUAGE CPP #-}+{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE BangPatterns #-} {-| Module : GVTI Description : GraphViz Tabular Interface main conversion functionality.-Copyright : (c) OleksandrZhabenko, 2017-2022+Copyright : (c) Oleksandr Zhabenko, 2017-2023 License : MIT-Maintainer : olexandr543@yahoo.com+Maintainer : oleksandr.zhabenko@yahoo.com Stability : Experimental A program @gvti@ converts a specially formated @.csv@ file with a colon as a field separator obtained from the electronic table@@ -17,12 +17,11 @@ module GVTI (getFormat,process2) where -#ifdef __GLASGOW_HASKELL__-#if __GLASGOW_HASKELL__>=710-/* code that applies only to GHC 7.10.* and higher versions */-import GHC.Base (mconcat)-#endif-#endif+import GHC.Base+import GHC.List+import GHC.Num+import System.IO+import Text.Show (show) import Data.List (nub) import System.Info (os) import System.CPUTime (getCPUTime)@@ -30,14 +29,7 @@ import GHC.Arr import EndOfExe (showE) import Data.Maybe (isJust,fromJust)-import Data.Foldable (foldr)--#ifdef __GLASGOW_HASKELL__-#if __GLASGOW_HASKELL__==708-/* code that applies only to GHC 7.8.* */-mconcat = concat-#endif-#endif+import qualified Data.Foldable as F (foldr) isSep :: Char -> Bool isSep = (== ':')@@ -108,7 +100,7 @@ parentCellContents n i arr | n == 0 = [] | ll == 0 = []- | otherwise = (\(x, _, _) -> x) . foldr f ([], 0, ll) . amap (!! (n - 1)) $ arr+ | otherwise = (\(x, _, _) -> x) . F.foldr f ([], 0, ll) . amap (!! (n - 1)) $ arr where ll = numElements arr - i - 1 f e (e0, m, k) | m < k && not (null e) = (e, m + 1, k)@@ -197,7 +189,7 @@ [vs,spec] <- proc2Params xxs yys let u = take 1 vs if null u || u == "\n" || u == "\x0000"- then error "MMSyn4.processFile1: Please, specify the needed character."+ then error "GVTI.processFile1: Please, specify the needed character." else do let temp = fromJust . showE . (\x -> case x of { "c" -> "circo" ; "d" -> "dot" ; "f" -> "fdp" ; "n" -> "neato" ; "o" ->"osage" ; "p" -> "patchwork" ; "s" -> "sfdp" ; "t" -> "twopi" ; ~vv -> "sfdp" })@@ -214,9 +206,7 @@ specFormatFile :: IO String specFormatFile = do putStrLn "Please, specify the GraphViz output format for the file: "- mapM_ printFormF ["do", "xd", "ps", "pd", "sv", "sz", "fi", "pn", "gi", "jp", "je", "js", "im", "cm"]- putStrLn "otherwise there will be used the default -Tsvg"- getLine+ mapM printFormF ["do", "xd", "ps", "pd", "sv", "sz", "fi", "pn", "gi", "jp", "je", "js", "im", "cm"] >> putStrLn "otherwise there will be used the default -Tsvg" >> getLine {-# INLINE specFormatFile #-} proc2Params2 :: String -> String -> IO [String]@@ -229,9 +219,7 @@ getFormat1 :: Int -> IO String getFormat1 1 = do putStrLn "Please, specify the GraphViz command: "- mapM_ printGraphFilter ["d","f","t","c","n","s","p","o"]- putStrLn "otherwise there will be used the default sfdp"- getLine+ mapM printGraphFilter ["d","f","t","c","n","s","p","o"] >> putStrLn "otherwise there will be used the default sfdp" >> getLine getFormat1 _ = specFormatFile {-# INLINE getFormat1 #-}
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2019-2022 OleksandrZhabenko+Copyright (c) 2019-2023 Oleksandr Zhabenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
Main.hs view
@@ -1,21 +1,27 @@ {-| Module : Main Description : The "glue" between spreadsheets and GraphViz-Copyright : (c) OleksandrZhabenko, 2017-2022+Copyright : (c) Oleksandr Zhabenko, 2017-2023 License : MIT-Maintainer : olexandr543@yahoo.com+Maintainer : oleksandr.zhabenko@yahoo.com Stability : Experimental -A program @mmsyn4@ converts a specially formated @.csv@ file with a colon as a field separator obtained from the electronic table +A program @gvti@ converts a specially formated @.csv@ file with a colon as a field separator obtained from the electronic table into a visualized by GraphViz graph in the one of the supported by GraphViz format. The proper GraphViz installation is required. -} +{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_HADDOCK -show-extensions #-}+ module Main where +import GHC.Base+import GHC.List+import System.IO (readFile) import GVTI (process2) import System.Environment (getArgs) import System.Directory-import Data.List (isPrefixOf)+import Data.List (isPrefixOf, lines, unlines) import Data.Char (isLetter, isDigit) import Formatting (formatLines)
gvti.cabal view
@@ -2,14 +2,14 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: gvti-version: 0.2.0.1+version: 0.3.0.0 synopsis: GraphViz Tabular Interface description: Introduces a new file extension .gvti and is a special tabular or line-based GraphViz subset interface. Is a fork of the now deprecated mmsyn4 package. homepage: https://hackage.haskell.org/package/gvti license: MIT license-file: LICENSE author: OleksandrZhabenko-maintainer: olexandr543@yahoo.com+maintainer: oleksandr.zhabenko@yahoo.com copyright: Oleksandr Zhabenko category: Graphics build-type: Simple@@ -19,15 +19,15 @@ library exposed-modules: GVTI, Formatting -- other-modules:- other-extensions: CPP, BangPatterns- build-depends: base >=4.7 && <5, directory >=1 && <2, process >=1.2 && <2, mmsyn3 ==0.1.6.0+ other-extensions: BangPatterns, NoImplicitPrelude+ build-depends: base >=4.13 && <5, directory >=1.3.4.0 && <2, process >=1.6.5.1 && <2, mmsyn3 ==0.2.0.0 -- hs-source-dirs: default-language: Haskell2010 executable gvti main-is: Main.hs other-modules: GVTI, Formatting- other-extensions: CPP, BangPatterns- build-depends: base >=4.7 && <5, directory >=1 && <2, process >=1.2 && <2, mmsyn3 ==0.1.6.0+ other-extensions: BangPatterns, NoImplicitPrelude+ build-depends: base >=4.13 && <5, directory >=1.3.4.0 && <2, process >=1.6.5.1 && <2, mmsyn3 ==0.2.0.0 -- hs-source-dirs: default-language: Haskell2010