on master help sign in
Improve style, remove unused brkt function
commitf6024d99f30b3e2cfcf2f662feb12b4712d01da9 authorEvan Czaplicki <info@elm-lang.org> dateMon 9 Feb 2015, 23:12 (12 years ago) parenta0c0bc5
1 file changed+8−6
src/AST/Helpers.hs+8−6
src/AST/Helpers.hs+8−6
@@ -4,7 +4,8 @@ module AST.Helpers where
44import qualified Data.Char as Char
55
66splitDots :: String -> [String]
7−splitDots = go []
7+splitDots variable =
8+ go [] variable
89 where
910 go vars str =
1011 case break (=='.') str of
@@ -12,16 +13,17 @@ splitDots = go []
1213 | otherwise -> go (vars ++ [x]) rest
1314 (x,[]) -> vars ++ [x]
1415
15−brkt :: String -> String
16−brkt s = "{ " ++ s ++ " }"
1716
1817isTuple :: String -> Bool
1918isTuple name =
20− take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
19+ take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
20+
2121
2222isOp :: String -> Bool
23−isOp = all isSymbol
23+isOp name =
24+ all isSymbol name
25+
2426
2527isSymbol :: Char -> Bool
2628isSymbol c =
27− Char.isSymbol c || elem c "+-/*=.$<>:&|^?%#@~!"
29+ Char.isSymbol c || elem c "+-/*=.$<>:&|^?%#@~!"