elm/compiler/SourceSyntax/Helpers.hs
Evan Czaplicki 2d4afca06f Fix JS generation
correct generation of binops
use correct calling conventions for defining functions
only import modules by name since everything is canonical (no more
eval!)
simplify exports
have _op be a per module object (resolves "overwriting" problem)
2013-07-29 23:22:33 +02:00

18 lines
363 B
Haskell

module SourceSyntax.Helpers where
import qualified Data.Char as Char
brkt :: String -> String
brkt s = "{ " ++ s ++ " }"
isTuple :: String -> Bool
isTuple name =
take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
isOp :: String -> Bool
isOp = all isSymbol
isSymbol :: Char -> Bool
isSymbol c =
Char.isSymbol c || elem c "+-/*=.$<>:&|^?%#@~!"