summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2013-12-26 23:54:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2013-12-26 23:54:00 (GMT)
commit88e4f7156ceb7f6c36368b83fd2c0ddf9ece98ea (patch)
tree57e8d21981eb3d87eff66889d39da70a104e1924
parentd4114a5ab787288592010d9ddb50e810adeaf2c4 (diff)
version 0.2.1.20.2.1.2
-rw-r--r--purescript.cabal2
-rw-r--r--src/Language/PureScript/Scope.hs6
2 files changed, 6 insertions, 2 deletions
diff --git a/purescript.cabal b/purescript.cabal
index c8f7405..dc510dd 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.2.1.1
+version: 0.2.1.2
cabal-version: >=1.8
build-type: Simple
license: MIT
diff --git a/src/Language/PureScript/Scope.hs b/src/Language/PureScript/Scope.hs
index 5b3e73b..677f79a 100644
--- a/src/Language/PureScript/Scope.hs
+++ b/src/Language/PureScript/Scope.hs
@@ -26,7 +26,6 @@ import Language.PureScript.Values
import Language.PureScript.Names
import Language.PureScript.CodeGen.JS.AST
import Data.Maybe (mapMaybe)
-import Text.Read (readMaybe)
usedNames :: (Data d) => d -> [Ident]
usedNames val = nub $ everything (++) (mkQ [] namesV `extQ` namesS `extQ` namesB `extQ` namesJS) val
@@ -69,3 +68,8 @@ firstUnusedName val =
toUnknown :: Ident -> Maybe Int
toUnknown (Ident ('_' : s)) = readMaybe s
toUnknown _ = Nothing
+
+readMaybe :: String -> Maybe Int
+readMaybe s = case reads s of
+ [(n, "")] -> Just n
+ _ -> Nothing