summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2014-06-26 23:28:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-06-26 23:28:00 (GMT)
commit44a53b9bc9a3d7dd07de606104056b6aea068eb8 (patch)
tree3477221560a80a2d1920f4ab5fa906dfc32c060e
parented750050ad0d94bd8379a8692f336b7b6ecd639d (diff)
version 0.5.2.50.5.2.5
-rw-r--r--purescript.cabal6
-rw-r--r--src/Language/PureScript/Optimizer.hs3
-rw-r--r--src/Language/PureScript/Optimizer/Unused.hs11
3 files changed, 5 insertions, 15 deletions
diff --git a/purescript.cabal b/purescript.cabal
index 32b87b2..96d47e6 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.5.2.4
+version: 0.5.2.5
cabal-version: >=1.8
build-type: Custom
license: MIT
@@ -17,6 +17,10 @@ author: Phil Freeman <paf31@cantab.net>,
data-files: prelude/prelude.purs
data-dir: ""
+source-repository head
+ type: git
+ location: https://github.com/purescript/purescript.git
+
library
build-depends: base >=4 && <5, cmdtheline == 0.2.*, containers -any, unordered-containers -any,
directory >= 1.2, filepath -any, mtl >= 2.1.0 && < 2.2.0, parsec -any,
diff --git a/src/Language/PureScript/Optimizer.hs b/src/Language/PureScript/Optimizer.hs
index b06ff4d..d75c234 100644
--- a/src/Language/PureScript/Optimizer.hs
+++ b/src/Language/PureScript/Optimizer.hs
@@ -19,8 +19,6 @@
--
-- * Inlining of (>>=) and ret for the Eff monad
--
--- * Removal of unused variables
---
-- * Removal of unnecessary thunks
--
-- * Eta conversion
@@ -57,7 +55,6 @@ optimize opts | optionsNoOptimizations opts = id
[ collapseNestedBlocks
, tco opts
, magicDo opts
- , removeUnusedVariables
, removeCodeAfterReturnStatements
, unThunk
, etaConvert
diff --git a/src/Language/PureScript/Optimizer/Unused.hs b/src/Language/PureScript/Optimizer/Unused.hs
index a3e07a0..c0de762 100644
--- a/src/Language/PureScript/Optimizer/Unused.hs
+++ b/src/Language/PureScript/Optimizer/Unused.hs
@@ -14,23 +14,12 @@
-----------------------------------------------------------------------------
module Language.PureScript.Optimizer.Unused (
- removeUnusedVariables,
removeCodeAfterReturnStatements
) where
import Language.PureScript.CodeGen.JS.AST
import Language.PureScript.Optimizer.Common
-removeUnusedVariables :: JS -> JS
-removeUnusedVariables = everywhereOnJS (removeFromBlock withBlock)
- where
- withBlock :: [JS] -> [JS]
- withBlock sts = go sts sts
- go :: [JS] -> [JS] -> [JS]
- go _ [] = []
- go sts (JSVariableIntroduction var _ : rest) | not (any (isUsed var) sts) = go sts rest
- go sts (s : rest) = s : go sts rest
-
removeCodeAfterReturnStatements :: JS -> JS
removeCodeAfterReturnStatements = everywhereOnJS (removeFromBlock go)
where