Open shriram opened 7 years ago
Even if we comment out the check block, the rest of this program does produce a type error, complaining that lz-map
call on line 40 should have a thunk type but doesn't. So the type checker is correct here regardless of the check block
The display of unbound type variables is ugly (<?-1>
, <?-2>
etc). Matthew and I agree we should present these as names, eg as spreadsheet-column names A,...Z,AA...AZ,BA...BZ etc, while avoiding any names already seen. So the message here would look like, "The type constraint ( -> Stream<A>)
was incompatible with the type constraint Stream<A>
, for some unknown type A
", assuming that nothing in the current type inference problem used the name A
already.
The definition of
lz-map
below has an intentional error: I wanted to see what would happen if I failed to thunk the rest argument tolz-link
. There's no error at all. However, once I add the check block afterwards, I get an error in the first test (take(5, twos)
). If I add a thunk to the penultimate line oflz-map
it type-checks and runs correctly (but, boy, is it slow as molasses).