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