You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the typechecker tries to inspect this, I get an internal error:
../../../../Applications/Racket v7.0/collects/racket/private/map.rkt:180:2: andmap: all lists must have same size
first list length: 1
other list length: 2
procedure: #<procedure:types-match?!>
The text was updated successfully, but these errors were encountered:
The typechecker looks up the information for Show and tries to zip the argument types with the instance type variables.
The arity mismatch is never caught, so the typechecker explodes.
The easy fix would be to insert some ad-hoc arity-checking code that complains about the mismatch. The right fix is to implement actual kindchecking, since (Show s (Eq s)) is an ill-kinded type. I’ve been putting kindchecking off for ages, though, since it would take a lot of thought and possibly some serious refactoring, so maybe the quick fix is the right thing for now.
Here’s a function with more than one constraint, that typechecks fine:
I originally messed up the syntax, and thought that
forall
’s second parameter was a list:(forall [s] ((Show s) (Eq s)) => {s -> s -> Bool})
When the typechecker tries to inspect this, I get an internal error:
The text was updated successfully, but these errors were encountered: