([Function _ _ _], _) = Left ["Start cannot have arguments"]
instance toString Scheme where
+ toString (Forall [] t) = toString t
toString (Forall as t) = concat ["A.", join " " (map toString as), ": ", toString t]
instance toString Type where
lex :: [Char] -> Either [String] [Token]
lex [] = pure []
+lex ['//\n':ts] = lex ts
+lex ['//',t:ts] = lex ['/','/':ts]
+lex ['/**/':ts] = lex $ dropWhile ((<>)'\n') ts
+lex ['/*',t:ts] = lex ['/','*':ts]
lex [';':ts] = TTSemiColon <:> lex ts
lex [')':ts] = TTBrackClose <:> lex ts
lex ['(':ts] = TTBrackOpen <:> lex ts