Browse files

Prep for release on hackage.

Signed-off-by: Austin Seipp <mad.one@gmail.com>
  • Loading branch information...
1 parent 7805451 commit f1e3d4b5577069bf59003c77a86c4e9613157bd3 @thoughtpolice committed Aug 7, 2012
Showing with 123 additions and 51 deletions.
  1. +4 −2 .gitignore
  2. +2 −0 AUTHORS.txt
  3. +0 −22 LICENSE
  4. +31 −0 LICENSE.txt
  5. +41 −0 README.md
  6. +3 −4 Strict/Pass.lhs
  7. +38 −23 strict-ghc-plugin.cabal
  8. +4 −0 tests/Makefile
View
6 .gitignore
@@ -2,5 +2,7 @@ _darcs
*.o
*.hi
*~
-tests/NonTerminating
-dist
+dist*
+tests/*.o
+tests/*.hi
+tests/Traced
View
2 AUTHORS.txt
@@ -0,0 +1,2 @@
+Original author: Max Bolingbroke
+Maintainer: Austin Seipp <mad.one@gmail.com>
View
22 LICENSE
@@ -1,22 +0,0 @@
-Copyright (c) 2008-2011, Maximilian Bolingbroke, Austin Seipp
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted
-provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
- * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to
- endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
31 LICENSE.txt
@@ -0,0 +1,31 @@
+The Glasgow Haskell Compiler License
+
+Copyright 2002, The University Court of the University of Glasgow.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+- Neither name of the University nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
+GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
View
41 README.md
@@ -0,0 +1,41 @@
+# GHC plugin for making functions strict.
+
+This plugin gives an example of defining a compiler plugin for
+GHC. You mark functions with the `Strictify` annotation and GHC makes
+the function strict (by recursively expanding non-recursive let
+bindings into case bindings.)
+
+[travis-ci.org](http://travis-ci.org) results: [![Build Status](https://secure.travis-ci.org/thoughtpolice/strict-ghc-plugin.png?branch=master)](http://travis-ci.org/thoughtpolice/strict-ghc-plugin)
+
+[Homepage][main page].
+
+# Installation
+
+Install the latest version of the plugin from Hackage (requires GHC 7.4.1):
+
+ $ cabal install strict-ghc-plugin
+
+# Join in
+
+File bugs in the GitHub [issue tracker][].
+
+Master [git repository][gh]:
+
+* `git clone https://github.com/thoughtpolice/strict-ghc-plugin.git`
+
+There's also a [BitBucket mirror][bb]:
+
+* `git clone https://bitbucket.org/thoughtpolice/strict-ghc-plugin.git`
+
+# Authors
+
+See [AUTHORS.txt](https://raw.github.com/thoughtpolice/strict-ghc-plugin/master/AUTHORS.txt).
+
+# License
+
+BSD3. See `LICENSE.txt` for terms of copyright and redistribution.
+
+[main page]: http://thoughtpolice.github.com/strict-ghc-plugin
+[issue tracker]: http://github.com/thoughtpolice/strict-ghc-plugin/issues
+[gh]: http://github.com/thoughtpolice/strict-ghc-plugin
+[bb]: http://bitbucket.org/thoughtpolice/strict-ghc-plugin
View
7 Strict/Pass.lhs
@@ -7,7 +7,6 @@ import GhcPlugins
import Control.Monad
import Data.Generics
-import Data.Maybe
import Strict.Annotation
@@ -21,9 +20,9 @@ strictifyProgram guts = do
return $ guts { mg_binds = newBinds }
strictifyFunc :: ModGuts -> CoreBind -> CoreM CoreBind
-strictifyFunc guts x@(NonRec b e) = do
- b <- shouldStrictify guts b
- case b of
+strictifyFunc guts x@(NonRec b _) = do
+ b' <- shouldStrictify guts b
+ case b' of
True -> everywhereM (mkM strictifyExpr) x
False -> return x
strictifyFunc guts x@(Rec bes) = do
View
61 strict-ghc-plugin.cabal
@@ -1,28 +1,43 @@
-Name: strict-ghc-plugin
-Version: 0.1
-License: BSD3
-License-File: LICENSE
-Synopsis: Turn Haskell into a strict language with a compiler plugin
-Description: This library allows you to annotate top-level function definitions, and the compiler will make them strict functions as opposed to lazy - you can turn Haskell into a strict language!
-Cabal-Version: >= 1.10
-Build-Type: Simple
-Author: Max Bolingbroke <batterseapower@hotmail.com>
-Maintainer: Austin Seipp <as@hacks.yi.org>
-Homepage: http://github.com/thoughtpolice/strict-ghc-plugin
-Bug-reports: https://github.com/thoughtpolice/strict-ghc-plugin/issues
+name: strict-ghc-plugin
+version: 0.0
+synopsis: Compiler plugin for making Haskell strict
+description:
+ This plugin gives an example of defining a compiler plugin for
+ GHC. You mark functions with the `Strictify` annotation and GHC
+ makes the function strict (by recursively expanding non-recursive
+ let bindings into case bindings.)
+homepage: http://thoughtpolice.github.com/strict-ghc-plugin
+bug-reports: http://github.com/thoughtpolice/strict-ghc-plugin/issues
+license: BSD3
+license-file: LICENSE.txt
+copyright: Copyright (c) the GHC authors
+author: The GHC authors
+maintainer: Austin Seipp <mad.one@gmail.com>
+category: Compiler Plugin
+build-type: Simple
+cabal-version: >=1.10
+tested-with: GHC == 7.4.1
+
+extra-source-files:
+ AUTHORS.txt README.md
+ tests/*.hs tests/Makefile
source-repository head
type: git
location: https://github.com/thoughtpolice/strict-ghc-plugin.git
-Library
- Exposed-Modules:
- Strict.Plugin
- Strict.Annotation
- Other-Modules:
- Strict.Pass
- Build-Depends:
- base,
- syb,
- ghc >= 7.2
- default-language: Haskell98
+library
+ exposed-modules:
+ Strict.Plugin
+ Strict.Annotation
+ other-modules:
+ Strict.Pass
+ build-depends:
+ base >= 4,
+ ghc >= 7.4,
+ syb
+
+ ghc-options: -Wall -O2 -funbox-strict-fields
+ -fwarn-tabs
+ default-extensions: CPP
+ default-language: Haskell2010
View
4 tests/Makefile
@@ -0,0 +1,4 @@
+all:
+ ghc -O2 -fforce-recomp -fplugin Strict.Plugin NonTerminating
+clean:
+ rm -f *.o *.hi NonTerminating

0 comments on commit f1e3d4b

Please sign in to comment.