summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-05-28 17:53:38 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2012-05-28 17:53:38 +0200
commitc64687ad08ba0dff16422990d6dfe2934feaa0a8 (patch)
treeeeb9b1982049afd09d3f4fc25f6601e26dd63221
parent98c325e605d741a8d4568762da630486229cabd8 (diff)
downloadstylish-haskell-0.1.0.0.tar.gz
Update README, cabal file0.1.0.0
-rw-r--r--README.markdown50
-rw-r--r--examples/Bad.hs14
-rw-r--r--stylish-haskell.cabal8
3 files changed, 68 insertions, 4 deletions
diff --git a/README.markdown b/README.markdown
index ead788d..9a02035 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1,21 +1,28 @@
stylish-haskell
===============
-[![Build Status](https://secure.travis-ci.org/jaspervdj/stylish-haskell-imports.png?branch=master)](http://travis-ci.org/jaspervdj/stylish-haskell-imports)
+[![Build Status](https://secure.travis-ci.org/jaspervdj/stylish-haskell.png?branch=master)](http://travis-ci.org/jaspervdj/stylish-haskell)
Introduction
------------
-A simple Haskell code prettifier
+A simple Haskell code prettifier. The goal is not to format all of the code in
+a file, since I find those kind of tools often "get in the way".
+
+Instead, this tool just tries to help where necessary.
Features
--------
- Aligns and sorts `import` statements
-- Groups and wraps `{-# LANGUAGE #-}` pragmas (WIP)
+- Groups and wraps `{-# LANGUAGE #-}` pragmas
- Removes trailing whitespace
- Replaces tabs by four spaces
+Feature requests are welcome! Use the [issue tracker] for that.
+
+[issue tracker]: https://github.com/jaspervdj/stylish-haskell/issues
+
VIM integration
---------------
@@ -25,3 +32,40 @@ Just call
:%!stylish-haskell
or add a keybinding for it.
+
+Example
+-------
+
+Turns:
+
+ -- | Some badly formatted Haskell code
+
+ {-# LANGUAGE ViewPatterns, TemplateHaskell #-}
+ {-# LANGUAGE GeneralizedNewtypeDeriving,
+ ViewPatterns,
+ ScopedTypeVariables #-}
+
+ module Bad where
+
+ import Control.Applicative ((<$>))
+ import System.Directory (doesFileExist)
+
+ import qualified Data.Map as M
+ import Data.Map ((!), keys, Map)
+
+into:
+
+ -- | Some badly formatted Haskell code
+
+ {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+ {-# LANGUAGE ScopedTypeVariables #-}
+ {-# LANGUAGE TemplateHaskell #-}
+ {-# LANGUAGE ViewPatterns #-}
+
+ module Bad where
+
+ import Control.Applicative ((<$>))
+ import System.Directory (doesFileExist)
+
+ import Data.Map (Map, keys, (!))
+ import qualified Data.Map as M
diff --git a/examples/Bad.hs b/examples/Bad.hs
new file mode 100644
index 0000000..d7e1ce1
--- /dev/null
+++ b/examples/Bad.hs
@@ -0,0 +1,14 @@
+-- | Some badly formatted Haskell code
+
+{-# LANGUAGE ViewPatterns, TemplateHaskell #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving,
+ ViewPatterns,
+ ScopedTypeVariables #-}
+
+module Bad where
+
+import Control.Applicative ((<$>))
+import System.Directory (doesFileExist)
+
+import qualified Data.Map as M
+import Data.Map ((!), keys, Map)
diff --git a/stylish-haskell.cabal b/stylish-haskell.cabal
index 8745ffd..10a2dca 100644
--- a/stylish-haskell.cabal
+++ b/stylish-haskell.cabal
@@ -1,7 +1,6 @@
Name: stylish-haskell
Version: 0.1.0.0
Synopsis: Haskell code prettifier
-Description: Haskell code prettifier
Homepage: https://github.com/jaspervdj/stylish-haskell
License: BSD3
License-file: LICENSE
@@ -12,6 +11,13 @@ Category: Language
Build-type: Simple
Cabal-version: >= 1.8
+Description:
+ A Haskell code prettifier. For more information, see:
+
+ .
+
+ <https://github.com/jaspervdj/stylish-haskell/blob/master/README.markdown>
+
Executable stylish-haskell
Ghc-options: -Wall -O2
Hs-source-dirs: src