hs2dot (empty) → 0.1.1
raw patch · 4 files changed
+113/−0 lines, 4 filesdep +basedep +directorydep +haskell-srcsetup-changed
Dependencies added: base, directory, haskell-src, haskell-src-exts, haskell98, split
Files
- COPYING.txt +14/−0
- Setup.hs +2/−0
- hs2dot.cabal +73/−0
- src/Main.hs +24/−0
+ COPYING.txt view
@@ -0,0 +1,14 @@+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE+ Version 2, December 2004++ Copyright (C) 2010 Oscar Finnsson++ Everyone is permitted to copy and distribute verbatim or modified+ copies of this license document, and changing it is allowed as long+ as the name is changed.++ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION++ 0. You just DO WHAT THE FUCK YOU WANT TO.+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ hs2dot.cabal view
@@ -0,0 +1,73 @@+-- hs2graphviz.cabal auto-generated by cabal init. For additional+-- options, see+-- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr.+-- The name of the package.+Name: hs2dot++-- The package version. See the Haskell package versioning policy+-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for+-- standards guiding when and how versions should be incremented.+Version: 0.1.1++-- A short (one-line) description of the package.+Synopsis: Generate graphviz-code from Haskell-code.++-- A longer description of the package.+Description: + @hs2dot@ can generate graphviz code by analyzing Haskell source code.+ .+ Usage (to generate a pdf from a source code file Hack.hs)+ .+ > hs2dot Hack.hs | dot -T pdf -o Hack.pdf+ .+ You can analyze multiple modules together:+ .+ > hs2dot Foo.hs Bar.hs | dot -T png -o FooBar.png++-- URL for the project homepage or repository.+Homepage: http://www.github.com/finnsson/hs2graphviz++-- The license under which the package is released.+License: OtherLicense++-- The file containing the license text.+License-file: COPYING.txt++-- The package author(s).+Author: Oscar Finnsson++-- An email address to which users can send suggestions, bug reports,+-- and patches.+Maintainer: oscar.finnsson@gmail.com++-- A copyright notice.+-- Copyright: ++Category: Language++Build-type: Simple++-- Extra files to be distributed with the package, such as examples or+-- a README.+-- Extra-source-files: ++-- Constraint on the version of Cabal needed to build this package.+Cabal-version: >=1.2+++executable hs2dot + -- .hs or .lhs file containing the Main module.+ Main-is: Main.hs + + -- Packages needed in order to build this package.+ build-depends: base >= 4 && < 5, directory >= 1.0.1.1, split >= 0.1.2, haskell-src-exts >= 1.9.0, haskell98, haskell-src >= 1.0.1.3+ + -- Modules not exported by this package.+ -- Other-modules: + + -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.+ -- Build-tools: + + hs-source-dirs: src++
+ src/Main.hs view
@@ -0,0 +1,24 @@+module Main where++import Hs2Dot.Internals++import System.Environment (getArgs)+import System.IO (FilePath)+import Control.Monad (filterM)+import System.Directory (doesFileExist)++++main :: IO ()+main = do+ args <- getArgs+ files <- filterM doesFileExist args+ code <- files2dot files+ putStr $ if null files then manual else code++manual :: String+manual =+ "usage: hs2dot [files.hs]*\n" +++ "\n" +++ "The files must be Haskell source code that haskell-src-exts can parse.\n" +++ "Some restrictions apply to the source files that can be parsed!\n"