A bidirectional typechecking puzzle

54 points by Gabriella439


icefox

Congrats on turning the Complete And Easy paper into something that functions! And a good example of where bidi's greedy nature can cause subtle issues. (Not a knock against it, inference always has issues, the best you can do is decide which ones you want.) And also why, IMO, subtyping and type coercion are usually anti-features.

If you treat the data as a source of truth for the types, then you're really not going to be able to check if the data is malformed or not. You'll just get incorrect types when there's a mistake rather than an informative error, as demonstrated. Though now that I read again you're the creator of Dhall (<3) so you probably know more about this than me... Now that I think more, being able to take a bunch of data and generate a schema for it is interesting idea that deserves research. Just not sure I would call it "type checking", since types are kiiiiinda assumed to be prescriptive, not descriptive...