elm/compiler/SourceSyntax/Helpers.hs

14 lines
263 B
Haskell
Raw Normal View History

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