@@ -10,8 +10,14 @@ import Types.Substitutions (subst)
10import Types.Types
10import Types.Types
12builtins :: [(String,([X],Type))]
12builtins :: [(String,([X],Type))]
14+ let touch = ("t0", time) : map (flip (,) int) ["x","y","x0","y0","id"]
15+ state = [("text", string), ("start", int), ("end", int)]
13−builtins = [ ("String", ([], listOf char))
16+ in [ ("String", ([], listOf char))
14− , ("Time", ([], float)) ]
17+ , ("Time", ([], float))
18+ , ("Touch", ([], RecordT (Map.fromString touch) EmptyRecord))
19+ , ("TextState", ([], RecordT (Map.fromString state) EmptyRecord))
16get :: [Statement] -> Map.Map String ([X],Type)
22get :: [Statement] -> Map.Map String ([X],Type)
17get stmts = Map.fromList (builtins ++ concatMap getAlias stmts)
23get stmts = Map.fromList (builtins ++ concatMap getAlias stmts)