2d4afca06f
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)
18 lines
363 B
Haskell
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 "+-/*=.$<>:&|^?%#@~!"
|